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
$ -> | |
octavo.shortcuts["Ctrl+'"] = (position) -> | |
octavo.input (value) -> | |
return if not position.balanced | |
span = $("<span/>").text("").css | |
width: "9px" | |
height: "9px" | |
border: "1px solid #000" | |
background: value |
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
/** | |
* CoffeeScript Compiler v1.5.0 | |
* http://coffeescript.org | |
* | |
* Copyright 2011, Jeremy Ashkenas | |
* Released under the MIT License | |
*/ | |
(function(root){var CoffeeScript=function(){function require(t){return require[t]}return require["./helpers"]=new function(){var t=this;(function(){var e,n,i,r;t.starts=function(t,e,n){return e===t.substr(n,e.length)},t.ends=function(t,e,n){var i;return i=e.length,e===t.substr(t.length-i-(n||0),i)},t.compact=function(t){var e,n,i,r;for(r=[],n=0,i=t.length;i>n;n++)e=t[n],e&&r.push(e);return r},t.count=function(t,e){var n,i;if(n=i=0,!e.length)return 1/0;for(;i=1+t.indexOf(e,i);)n++;return n},t.merge=function(t,e){return n(n({},t),e)},n=t.extend=function(t,e){var n,i;for(n in e)i=e[n],t[n]=i;return t},t.flatten=i=function(t){var e,n,r,s;for(n=[],r=0,s=t.length;s>r;r++)e=t[r],e instanceof Array?n=n.concat(i(e)):n.push(e);return n},t.del=function(t,e){var n;return n=t[e],delete t[e],n},t.last=function(t,e){return t[t.length-(e||0)-1]},t.some=null!=(r=Array.prototype.some)?r:fun |
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/python | |
import sys, os, time, urllib, mmap | |
print 'Content-Type: text/plain; charset=utf-8' | |
query = os.environ['QUERY_STRING'] | |
query = urllib.unquote(query) | |
now = time.time() |
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
function contents() { | |
var first = $('h2:first'); | |
if (!first) return; | |
var p = '<p><strong>Contents</strong>'; | |
var ol = '<ol id="contents"></ol>'; | |
first.before('<div class="contents">' + p + ol + '</div>'); | |
var outer = $('#contents'); | |
$('h2, h3, h4').map(function (i) { |
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 | |
import urllib | |
def status(name): | |
u = urllib.urlopen("http://www.mywowarmory.com/realmstatus.php") | |
bytes = u.read() | |
u.close() | |
search = re.search('(?i)(up|down).png[^>]*>' + name, bytes) | |
if search: |
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
# Derived from http://pastebin.com/10egeE1a | |
# Original Copyright 2012, Paul | |
# License: Eiffel Forum License 2 | |
import re, urllib | |
def randomorg(max): | |
svcurl = "http://www.random.org/integers/?num=1&min=1&max=%d&col=1&base=10&format=plain&rnd=new" % max | |
u = urllib.urlopen(svcurl) | |
content = u.read() |
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 | |
import socket | |
import threading | |
import queue | |
import multiprocessing | |
import time | |
import commands | |
class Client(object): |
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
# remote python execution | |
# wolfram alpha service | |
# remote services? | |
import re, urllib.request, urllib.parse, traceback | |
from html.entities import name2codepoint | |
def error(who, message): | |
output = {"who": who, "message": message} | |
stack = traceback.extract_stack() |
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, re, urllib | |
from decimal import Decimal as dec | |
def error(message): | |
print message | |
sys.exit(1) | |
def parse_lat_lon_string(lat_lon): |
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.path, re, json, time, shutil, cgi | |
from htmlentitydefs import name2codepoint | |
sys.path.append( | |
os.path.expanduser("~/usr/opt/python-packages") | |
) | |
from twitter import Twitter, OAuth |