This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace QuizApp\Services; | |
class UserSessionService { | |
private $app; | |
private $container; | |
public function __construct($app, $container) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF = function(cond) { | |
return function(thn) { | |
return function(els) { | |
return cond(thn)(els); | |
} | |
} | |
} | |
tru = function(thn) { | |
return function(els) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |
OlderNewer