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
node_name = (node) -> | |
return node.nodeName.toLowerCase() | |
current_range = () -> | |
if window.getSelection | |
selection = window.getSelection() | |
if selection.getRangeAt and selection.rangeCount | |
return selection.getRangeAt 0 |
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
#!/usr/bin/env python | |
import sys, struct, binascii | |
def header(bytes): | |
return struct.unpack('>NNccccc', bytes) | |
def parse(bytes): | |
signature = bytes[:8] | |
bytes = bytes[8:] |
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 | |
# screenshottr! | |
# Take a screenshot on OS X and upload it to imgur using the "Anonymous" API | |
# Written by Sean B. Palmer | |
# Released under the Apache License 2.0. Viva la Libre! | |
# Abusest thou not this API key | |
API_KEY="273b7108a37679d9ac31ad5a9f1a314a" | |
SCREENSHOT="/tmp/$$.screenshot.png" | |
OUTPUT="/tmp/$$.output.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
a | |
able | |
about | |
account | |
acid | |
across | |
act | |
addition | |
adjustment | |
advertisement |
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
#!/usr/bin/env python | |
import sys | |
import os | |
import re | |
import subprocess | |
import shutil | |
r_tag = re.compile(r"(?s)<[^>]+>") | |
r_pre = re.compile(r"(?s)<pre([^>]+)>(.*?)</pre>") |
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
#!/usr/bin/env python | |
# $ python sitemap.py ~/sbp.so | pbcopy | |
import sys | |
import os | |
def help(): | |
print "Usage: sitemap.py [ docroot ]" | |
def main(): |
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 re, math, time, urllib, locale, socket, struct, datetime | |
from decimal import Decimal as dec | |
while True: | |
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
client.sendto('\x1b' + 47 * '\0', ('ntp1.npl.co.uk', 123)) | |
data, address = client.recvfrom(1024) | |
if data: | |
buf = struct.unpack('B' * 48, data) | |
d = dec('0.0') |
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
#!/usr/bin/env python | |
import sys, os, shutil, json | |
out = 'video.combo.js' | |
if os.path.exists(out): | |
print >> sys.stderr, 'Error: %s already exists' % out | |
sys.exit(1) |
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
<div> | |
<img src="https://upload.wikimedia.org/wikipedia/commons/7/77/Kirshhoff-example.svg" alt="Kirshhoff-example" class="resizable"> | |
</div> |
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/sh | |
GIST_USER=sbp | |
function usage() { | |
echo Usage: $0 [command], where command is one of: | |
echo update - Gets any new gists for user | |
echo pull - Keep existing gists synced with server | |
echo sync - Do an update then a pull | |
} |