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 hashlib | |
import httplib | |
with open("passwords.txt", "r") as file: | |
for password in file: | |
password = password.strip() | |
sha = hashlib.sha1(password).hexdigest().upper() | |
head = sha[:5] |
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
function Scope(parent, symbols) { | |
this.parent = parent; | |
this.symbols = symbols; | |
} | |
Scope.prototype.contains = function(key) { | |
if(this.symbols.hasOwnProperty(key)) { | |
return true; | |
} else if(this.parent !== null) { | |
return this.parent.contains(key); |
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
function parse(input) { | |
var i = 0; | |
function descend(input) { | |
var escape = false, | |
atom = '', | |
atomSet = []; | |
for(i; i<input.length; i++) { | |
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
function pop(input) { | |
var i = input.indexOf('(') + 1, // Start of out outermost s-expression | |
j = -1, // Will be set to the index of the matching ) to close the outsermost s-expression | |
l = 1, // Nesting 'stack counter' to make sure we get the outermost expression only | |
k = 0; // Loop index | |
if(i < 0) | |
return input; | |
for(k=i; k<input.length; 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
sieve :: [Integer] -> [Integer] | |
sieve [] = [] | |
sieve (x:xs) | |
| x < 2 = sieve xs | |
| otherwise = x : sieve (filter (\n -> n `mod` x /= 0) xs) |
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
quicksort :: (Ord a) => [a] -> [a] | |
quicksort [] = [] | |
quicksort (x:xs) = let lesser = filter (< x) xs | |
greaterThanOrEqual = filter (>= x) xs | |
in quicksort lesser ++ [x] ++ quicksort greaterThanOrEqual |
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
var sieve = function(xs) { | |
var head = xs[0], | |
tail = xs.slice(1); | |
if(head === undefined) return []; | |
if(head < 2) return sieve(tail); | |
tail = tail.filter(function(x) { | |
return x % head > 0 ? true : false; |
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
var flatten = function(nested) { | |
var head = nested.slice(0, 1), | |
tail = nested.slice(1), | |
type = Object.prototype.toString.call(head[0]); | |
if(nested.length === 0) return []; | |
if(type === '[object Array]') return flatten(head[0]).concat(tail); | |
return head.concat(flatten(tail)); |
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
function quicksort(input) { | |
if(input.length === 0) return input; | |
var head = input[0], | |
tail = input.slice(1); | |
var less = tail.filter(function(i) { | |
return i < head ? true : false; | |
}); |
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
Ext.create('Ext.grid.Panel', { | |
columns: [ | |
{ | |
xtype: 'actioncolumn', | |
isDisabled: function(value) { | |
return true; | |
}, | |
handler: function() { | |
this.fireEvent('customevent', arg1, arg2, ...); | |
} |