This file contains hidden or 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
# | |
# NB : this is not secure | |
# from http://code.activestate.com/recipes/266586-simple-xor-keyword-encryption/ | |
# added base64 encoding for simple querystring :) | |
# | |
def xor_crypt_string(data, key='awesomepassword', encode=False, decode=False): | |
from itertools import izip, cycle | |
import base64 | |
if decode: |
This file contains hidden or 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
var uniqueArray = function(arrArg) { | |
return arrArg.filter(function(elem, pos,arr) { | |
return arr.indexOf(elem) == pos; | |
}); | |
}; | |
var uniqEs6 = (arrArg) => { | |
return arrArg.filter((elem, pos, arr) => { | |
return arr.indexOf(elem) == pos; | |
}); |
This file contains hidden or 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 | |
git clone https://github.com/hashcat/hashcat.git | |
mkdir -p hashcat/deps | |
git clone https://github.com/KhronosGroup/OpenCL-Headers.git hashcat/deps/OpenCL | |
cd hashcat/ && make | |
./hashcat --version | |
./hashcat -b -D 1,2 | |
./example0.sh |
This file contains hidden or 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
id | username | last_name | created_at | first_name | hashed_password | ||
---|---|---|---|---|---|---|---|
1 | [email protected] | jmonroe99 | Munroe | NULL | Jim | $2y$11$Co5fHvH5Lgk2Zu0iHR46BO6fnqQt1pUljPbZOhk7bTU6hQFhjBJG. | |
2 | [email protected] | lbtables | Tables | 2016-06-03 19:33:54 | Bobby | $2y$10$I.Jwfc8R3xaFwlAlPn5U3OLAQXrE0c2fakN8rR4j2TW0gRVMd6U6a | |
3 | [email protected] | pperson | Person | 2017-01-01 02:50:26 | Pat | $2y$11$FHZQn1eWZ3mbn11evb3CSeM20LCsJZI8yP9wS/UsOI6VWnx.7mKDa |
This file contains hidden or 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
var sum = function (a, b, f) { return f(null, a + b) } | |
var test = require('tap').test; | |
test('sums 1 and 2', function (t) { | |
sum(1, 2, function (err, result) { | |
t.notOk(err, 'no error'); | |
t.equal(result, 3, '1 + 2 should be equal to 3'); | |
t.end(); | |
}); |
This file contains hidden or 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
var Twitter = require('twitter') | |
var bunyan = require('bunyan'); | |
var log = bunyan.createLogger({name: 'mytweet'}); | |
log.info('hi'); | |
var client = new Twitter({ | |
consumer_key: '***************', | |
consumer_secret: '***************', | |
access_token_key: '***************', |
This file contains hidden or 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
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
// add tests | |
suite.add('shift', function() { | |
let arr = [1,2,3,4,5,6,7,8,9,0] | |
for (let i in arr) { | |
arr.shift() | |
} | |
}) | |
.add('slice', function() { |
This file contains hidden or 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
/* | |
* Takes input as date-dtring in the format of mm/dd/yyyy and verifies that it's a valid date | |
* by creating a date object out of it and comparing the year/month/day to the given ones | |
*/ | |
function isDate(date) { | |
var objDate, // date object initialized from the date string | |
mSeconds, // date in milliseconds | |
day, // day | |
month, // month | |
year; // year |
This file contains hidden or 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
#!/apps/python/bin/python | |
import logging | |
import gspread | |
from creds import API_ACCESS_KEY, get_client_email, get_private_key | |
logger = logging.getLogger('nflx.' + __name__) | |
headers = { | |
'Authorization': 'Token token={0}'.format(API_ACCESS_KEY), | |
'Content-type': 'application/json', |
This file contains hidden or 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
public static final Map<String, String> STATE_MAP; | |
static { | |
STATE_MAP = new HashMap<String, String>(); | |
STATE_MAP.put("AL", "Alabama"); | |
STATE_MAP.put("AK", "Alaska"); | |
STATE_MAP.put("AB", "Alberta"); | |
STATE_MAP.put("AZ", "Arizona"); | |
STATE_MAP.put("AR", "Arkansas"); | |
STATE_MAP.put("BC", "British Columbia"); | |
STATE_MAP.put("CA", "California"); |