text:
    <meta content='{{ site.title }}' property='og:title' />
    <title>{{ site.title }}</title>
    {% include head.html %}

    {% include header.html %}

        {{ content }}

    {% include footer.html %}

redpajama_set_name: RedPajamaGithub


text:
package org.bbqapp.android.view.login;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.facebook.login.widget.LoginButton;
import com.google.android.gms.common.SignInButton;

import org.bbqapp.android.R;
import org.bbqapp.android.auth.AuthCancel;
import org.bbqapp.android.auth.AuthData;
import org.bbqapp.android.auth.AuthError;
import org.bbqapp.android.auth.AuthEvent;
import org.bbqapp.android.auth.AuthInit;
import org.bbqapp.android.auth.Facebook;
import org.bbqapp.android.auth.GooglePlus;
import org.bbqapp.android.view.BaseFragment;
import org.bbqapp.android.view.LoginManager;

import javax.inject.Inject;

import butterknife.Bind;
import butterknife.OnClick;
import de.halfbit.tinybus.Subscribe;
import de.halfbit.tinybus.TinyBus;

/**
 * Fragment for user login operations
 */
public class LoginFragment extends BaseFragment implements View.OnClickListener {

    @Inject
    TinyBus bus;

    @Inject
    LoginManager loginManager;

    @Inject
    Activity activity;

    @Bind(R.id.login_buttons)
    LinearLayout loginButtons;

    @Bind(R.id.login_info)
    LinearLayout loginInfo;

    @Bind(R.id.login_name)
    TextView nameText;

    private final Object authEventsLock = new Object();

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.view_login, container, false);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onResume() {
        super.onResume();
        getActivity().setTitle(R.string.menu_login);

        bus.register(this);

        loginButtons.setVisibility(View.GONE);
        loginInfo.setVisibility(View.GONE);

        initOrUpdate();
    }

    @Override
    public void onPause() {
        super.onPause();

        bus.unregister(this);

        loginButtons.removeAllViews();
    }

    @Override
    public void onStop() {
        super.onStop();

        getProgressbar().setIndeterminate(false);
    }

    private void initOrUpdate() {
        synchronized (authEventsLock) {
            AuthData authData = loginManager.getLastAuthData();
            boolean loggedIn = authData != null && authData.isLoggedIn();
            boolean initialized = loginManager.isInitialized();
            boolean busy = loginManager.isBusy();

            getProgressbar().setIndeterminate(busy);

            if (loggedIn) {
                displayAuthData(authData);
            } else if (!busy && !initialized) {
                loginManager.init();
            } else if (initialized) {
                displayLoginButtons();
            }
        }
    }

    private void displayAuthData(AuthData authData) {
        loginButtons.setVisibility(View.GONE);
        loginInfo.setVisibility(View.VISIBLE);

        nameText.setText(authData.getDisplayName());
    }

    private void displayLoginButtons() {
        loginButtons.setVisibility(View.VISIBLE);
        loginInfo.setVisibility(View.GONE);

        loginButtons.removeAllViews();
        View button;
        for (String serviceId : loginManager.getAuthServiceIds()) {
            button = createButton(serviceId);
            if (button != null) {
                loginButtons.addView(button);
            }
        }
    }

    @OnClick(R.id.logout_button)
    protected void logout() {
        getProgressbar().setIndeterminate(true);
        loginManager.logout();
    }

    @Subscribe
    public void onAuthEvent(AuthEvent authEvent) {
        initOrUpdate();
    }

    @Subscribe
    public void onAuthError(AuthError authError) {
        onAuthEvent(authError);
    }

    @Subscribe
    public void onAuthCancel(AuthCancel authCancel) {
        onAuthEvent(authCancel);
    }

    @Subscribe
    public void onAuthData(AuthData authData) {
        onAuthEvent(authData);
    }

    @Subscribe
    public void onAuthInit(AuthInit authInit) {
        onAuthEvent(authInit);
    }

    private View createButton(String serviceId) {
        View button;
        switch (serviceId) {
            case GooglePlus.ID:
                button = new SignInButton(activity);
                break;
            case Facebook.ID:
                button = new LoginButton(activity);
                break;
            default:
                button = null;
        }

        if (button != null) {
            button.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
            button.setOnClickListener(this);
        }

        return button;
    }

    @Override
    public void onClick(View v) {
        getProgressbar().setIndeterminate(true);
        if (v instanceof SignInButton) {
            loginManager.login(GooglePlus.ID);
        } else if (v instanceof LoginButton) {
            loginManager.login(Facebook.ID);
        }
    }
}


text:
from pyquery import PyQuery
from BeautifulSoup import BeautifulSoup, Comment
import json
import os
import time
import sys

reportsFolder = '.'

def dict_from_html(htmlPath):
    json_dict = {
        'report': 'reports/' + htmlPath
    }

    mapping = {'BUGDESC': 'desc',
                'BUGTYPE': 'type',
                'BUGCATEGORY': 'category',
                'FILENAME': 'filename',
                'FUNCTIONNAME': 'function',
                'BUGLINE': 'line',
                'BUGCOLUMN': 'column',
                'BUGFILE': 'path'}

    # load html into string
    with open(htmlPath, 'r') as content_file:
        content = content_file.read()

    # parse html
    soup = BeautifulSoup(content)
    comments = soup.findAll(text = lambda text: isinstance(text, Comment))

    # grab needed comments
    for c in comments:
        # analyze interesting stuff
        stripped = c.strip()

        for key in mapping.keys():
            if key in stripped:
                # line[len(prefix):]
                json_dict[mapping[key]] = stripped[(len(key)+1):]
                del mapping[key]

    return json_dict;

def list_from_htmls(folderPath):
    # key is path
    # value is violation
    result_dict = {}
    files = filter(lambda path: path.endswith('.html'), os.listdir(folderPath))

    for f in files:
        if "Pods/" not in f:
            jd = dict_from_html(f)
            # result_list.append(jd)
            path = jd['path']
            if result_dict.has_key(path):
                existing_array = result_dict[path]
                existing_array.append(jd)
            else:
                result_dict[jd['path']] = [jd]

    # now generate final list
    result_list = []
    for k in result_dict.keys():
        d = {}

        d['path'] = k
        d['violations'] = result_dict[k]

        # just remove path from violations
        for v in d['violations']:
            del v['path']

        result_list.append(d)

    return result_list;

def report_for_folder(folderPath):
    result = {}
    summary = {}

    violations = list_from_htmls(folderPath)
    summary['files_count'] = len(violations)

    violations_count = 0
    for f in violations:
        for v in f['violations']:
            violations_count += 1
    summary['violations_count'] = violations_count
    summary['time'] = time.time()

    result['summary'] = summary
    result['files'] = violations

    return result;

# magic starts here...

# params
# first - html reports folder
# second - project name
if len(sys.argv) > 1:
    reportsFolder = sys.argv[1]

os.chdir(reportsFolder)
result = report_for_folder(reportsFolder)
print json.dumps(result)


text:
<?php

// autoload_files.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
    'cf150f72bd303a2ff07711c9a70f2d53' => $vendorDir . '/google/apiclient/src/Google/autoload.php',
);


text:
CHARS = {
  [1] = {
    name = "Will Knot",
    portrait = "default",
    startingRoom = 1,
    inventory = {},
    abilities = {
      [1] = {
        name = "Generate Phlegm",
        image = "ability",
        activate = function()
          local inv = gameEnv.data.activePlayer.inventory
          if inv[1] then
            simpleDiag("You can't Generate Phlegm when you're holding something!\n\nGet rid of your item first.", "Ability Failure", "info")
          else
            local phlegm = OBJECTS.phlegm
            inv[1] = Object(0, phlegm.name, phlegm.description, phlegm.image, phlegm.interaction, phlegm.position)
            simpleDiag("You sneeze into your hands. Good job.", "Ability Success", "info")
          end
        end
      }
    }
  }
}