Skip to content

Instantly share code, notes, and snippets.

View UndergroundLabs's full-sized avatar

UndergroundLabs UndergroundLabs

  • Underground Labs UK
  • Birmingham, United Kingdon
View GitHub Profile
import google from "google"
google.resultsPerPage = 25
let nextCounter = 0
google('james jeffery', (err, result) => {
if(err) console.error(err);
for(let i = 0; i < result.links.length; ++i) {
let link = result.links[i];
IF = function(cond) {
return function(thn) {
return function(els) {
return cond(thn)(els);
tru = function(thn) {
return function(els) {
namespace QuizApp\Routes;
use \Psr\Http\Message\ServerRequestInterface;
use \Psr\Http\Message\ResponseInterface;
use \Psr\Http\Message\RequestInterface;
$app->get('/login', function(ServerRequestInterface $req, ResponseInterface $resp) use ($config) {
namespace QuizApp\Services;
class UserSessionService {
private $app;
private $container;
public function __construct($app, $container)
define('ROOT_PATH', __DIR__ . '/../');
define('VENDOR_PATH', __DIR__ . '/../QuizApp/vendor/');
define('CONFIG_PATH', __DIR__ . '/../QuizApp/config/');
define('CONTROLLERS_PATH', __DIR__ . '/../controllers/');
define('TEMPLATE_PATH', __DIR__ . '/../QuizApp/temlates/');
define('APP_PATH', __DIR__ . '/../QuizApp/');
from flask import Blueprint, render_template, abort, jsonify, request
from flask.ext.login import login_required, current_user
from sqlalchemy.orm.exc import NoResultFound
from app import app, db
from app.models import Vote, Selfie
import datetime
vote_blueprint = Blueprint('vote', __name__, template_folder='templates')
def add_vote(user_id, selfie_id):
@app.route('/vote/<int:selfie_id>', methods=['GET'])
def vote(selfie_id):
selfie = models.Selfie.query.filter_by(id=selfie_id).first()
if not selfie:
return jsonify(error="Something went wrong.")
# Check if the user has already voted on this item
this_vote = models.Vote.query.filter_by(, selfie_id=selfie_id).first()
UndergroundLabs / gist:fad38205068ffb904685
Created October 3, 2015 19:46
Facebook Python Login Script
import argparse
import requests
import pyquery
def login(session, email, password):
Attempt to login to Facebook. Returns user ID, xs token and
// Setup the view
$di->set('view', function() use ($config){
// Create an events manager
$eventsManager = new EventsManager();
$eventsManager->attach('view:afterRender', new BanWordsPlugin());
$view = new View();