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
#!/usr/bin/env python
import requests
# Quick and dirty script to quickly scan an IP for SQ Webcam
def main():
# Load IP addresses from file
with open('ips.txt') as f:
ips = f.readlines()
Index.php
=========
// 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();
@UndergroundLabs
UndergroundLabs / gist:fad38205068ffb904685
Created October 3, 2015 19:46
Facebook Python Login Script
#!/home/drspock/scripts/FBInvite/bin/python
import argparse
import requests
import pyquery
def login(session, email, password):
'''
Attempt to login to Facebook. Returns user ID, xs token and
@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(user_id=current_user.id, selfie_id=selfie_id).first()
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):
<?php
session_start();
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/');
<?php
namespace QuizApp\Services;
class UserSessionService {
private $app;
private $container;
public function __construct($app, $container)
<?php
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) {
IF = function(cond) {
return function(thn) {
return function(els) {
return cond(thn)(els);
}
}
}
tru = function(thn) {
return function(els) {
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];