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
import binascii | |
import hashlib | |
import json | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives.ciphers import algorithms, Cipher, modes | |
from django.conf import settings | |
from pinecast.helpers import gravatar |
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
import binascii | |
# import codecs | |
import hashlib | |
import json | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives.ciphers import algorithms, Cipher, modes | |
from django.conf import settings | |
from pinecast.helpers import gravatar |
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
// this is crazy | |
Function.prototype.callMeMaybe = function(ctx) { | |
if (Math.random() > .5) { | |
return this.apply(ctx, Array.prototype.slice.call(arguments, 1)); | |
} | |
}; | |
function square(n) { | |
return n * n; | |
} |
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
"""BBEdit UNIX filter that wraps one or more optionally-indented, commented | |
lines to 79 chars, preserving indentation. | |
Just select all the lines (in their entirety) the comment spans, and invoke. | |
Works with #, --, and //-style comments. | |
For example, this... :: | |
# Upping this to 10000 makes it 3x faster. 10000 takes 15.936s. 5000 takes 16.303s. |
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 | |
# Which version should we fetch? | |
b2gremote="https://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/" | |
appname="B2G" | |
if [ "$1" == "aurora" ]; then | |
b2gremote="https://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-aurora/" | |
appname="B2GAurora" | |
fi |
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
$.fn.serializeObject = function() { | |
var data = {}; | |
_.each($(this).serializeArray(), function(v, k) { | |
k = v.name; | |
v = v.value; | |
if (_.contains(k, '__prefix__')) { | |
return; | |
} | |
if (k.match(/\-\d+\-/g)) { | |
// Turn `users-0-name=Basta` into |
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
/* | |
Original graphicsbc source: | |
a0,0 | |
p250,300 | |
t20,0 | |
L | |
10 | |
Ha0 ,255,128 |
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
def log_gen(n): | |
import math | |
y = 1 | |
while y < n: | |
adder = max(1, 10 ^^ int(math.log10(y))) | |
yield int(y) | |
y += adder |