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 geopy.geocoders import MapQuest, OpenMapQuest, Nominatim | |
omapquest_api_key = "APIKEYHERE" | |
gm = MapQuest(api_key=omapquest_api_key, timeout=60) | |
gom = OpenMapQuest(api_key=omapquest_api_key, timeout=60) | |
gn = Nominatim(timeout=60) | |
loc = "611 West Holt Blvd., ontario, ca, 91762" |
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
""" | |
Python implementation of PKCS #7 padding. | |
RFC 2315: PKCS#7 page 21 | |
Some content-encryption algorithms assume the | |
input length is a multiple of k octets, where k > 1, and | |
let the application define a method for handling inputs | |
whose lengths are not a multiple of k octets. For such | |
algorithms, the method shall be to pad the input at the | |
trailing end with k - (l mod k) octets all having value k - |
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 | |
""" | |
# Original Author: Tyler Lesmann | |
# Original Source: http://www.tylerlesmann.com/2009/apr/27/copying-databases-across-platforms-sqlalchemy/ | |
# TODO: Look at https://gist.github.com/thoas/1589496 if any | |
# "sequencing" issues come in to play. | |
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 os | |
import base64 | |
import flask | |
import urllib.parse | |
import requests | |
app = flask.Flask(__name__) | |
APP_ID = "ID" | |
APP_SECRET = "SECRET" |
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
//http://www-cs-students.stanford.edu/~tjw/jsbn/prng.js | |
// prng4.js - uses Arcfour as a PRNG | |
function Arcfour() { | |
this.i = 0; | |
this.j = 0; | |
this.S = new Array(); | |
} | |
// Initialize arcfour context from key, an array of ints, each from [0..255] |
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
#!/bin/bash | |
# /usr/local/sbin/rndaz09 N: Cat N urandom characters and return limited [a-z0-9] | |
# link: https://gist.github.com/adoc/275cba7ef1639cc648bb | |
# resource: http://stackoverflow.com/a/2793856 | |
cat /dev/urandom | tr -cd 'a-z0-9' | head -c $1 |
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
#!/bin/bash | |
# /usr/local/sbin/hashdeept $@: Hashdeep and trim "##" and "%%%%" lines | |
# author: https://github.com/adoc | |
# link: https://gist.github.com/adoc/8c117fb895c6dfdc962d | |
# resources: | |
# http://unix.stackexchange.com/a/174720 | |
# deps: | |
# hashdeep (http://md5deep.sourceforge.net/) | |
# todo: | |
# check incoming ards for -l and -j?? |
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
/* | |
backbone_auth.js | |
Provides bi-directional HMAC hooked in to Model and Collection. | |
Author: github.com/adoc | |
Location: https://gist.github.com/adoc/8613376 | |
*/ | |
define(['underscore', 'backbone', 'config', 'events', 'auth_client', 'persist'], |
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
// api calls outside of backbone. | |
var apiCall = function(uri, data, success, method) { | |
data = data || {}; | |
method = method || 'GET'; | |
$.ajax({ | |
method: method, | |
url: opts.apiRoot + uri, | |
data: method == 'POST' ? JSON.stringify(data) : data, | |
dataType: 'json', |
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
// Update the time provider and ip address. | |
// Called on every page, cause. | |
var tightenAuth22 = function() { | |
apiCall('/ping', {}, function(data) { | |
authApi.timeProvider.reset(data._time); | |
authApi.clientIp = data._addr; | |
authApi.tight = true; | |
if (opts.success) { | |
opts.success(); |
NewerOlder