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
<?php | |
/* | |
* schedule.php | |
* | |
* | |
* Created by Jay on 12/4/09, based on Han's Better Schedule Search. | |
* Gift-Economy license. See en.wikipedia.org/wiki/Gift_economy | |
* | |
*/ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>MathQuill Toolbar Demo</title> | |
<!--script type="text/javascript" src="mathquill/vendor/jquery.min.js"></script> | |
<script type="text/javascript" src="mathquill/build/mathquill.js"></script--> | |
<link rel="stylesheet" href="http://mathquill.com/mathquill.css"> |
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 parseTable(tbl) { | |
return tbl.find('tbody tr').map(function () { | |
return $(this).find('td').map(function () { | |
return $.trim($(this).text()); | |
}).get().join('\t'); | |
}).get().join('\n'); | |
} | |
var i = 0, page = 1, pages = 1; | |
(function loop() { | |
while (!addresses[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
#!/usr/local/bin/node | |
var fs = require('fs'); | |
var data = fs.readFileSync(process.argv[2]); | |
var target = fs.readFileSync(process.argv[3]); | |
var lines = (data+'').split('\n'); | |
var rows = (target+'').split('\n'); | |
var row = 0; |
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
/** | |
* Join | |
* Joins async callbacks with arguments concatenated. | |
* Usage: | |
* var join = new Join; | |
* getScore (angel, buffy, join()); | |
* getNextMatch (angel, join()); | |
* recordVisitAndGetInfo (angel, buffy, join()); | |
* join.after = function(score, next, vinfo) { | |
if (this.score > 0.9 && ! this.vinfo.last_visit) { |
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
javascript: | |
var minimap = document.body.cloneNode(true); | |
[].forEach.call(minimap.getElementsByTagName('a'), function(link) { | |
link.href = 'javascript:;'; | |
}); | |
minimap.style.position = 'fixed'; | |
minimap.style.webkitTransform = 'scale(.1)'; | |
document.body.appendChild(minimap); | |
minimap.style.top = minimap.offsetHeight*-.45+'px'; | |
minimap.style.right = minimap.offsetWidth*-.45+'px'; |
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
#!/bin/sh | |
PROJECT_NAME=$1 | |
if [ -z "$PROJECT_NAME" ]; then | |
echo "Usage: heroku-ready_django_startproject.sh projectname" | |
exit | |
fi | |
mkdir $PROJECT_NAME |
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
//because why not? | |
//please don't actually use this. Please use idiomatic JavaScript classes or a very thin class layer like github.com/jayferd/pjs | |
/* | |
Usage: | |
var Cat = PyClass({ | |
__init__: function(self, name) { | |
self.name = name; | |
}, | |
chase: function(self, prey) { |
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
import string | |
def name_scores(): | |
inputfile = open('./Downloads/names.txt') | |
inputstring = inputfile.read() | |
stringlist = inputstring.split(',') | |
strlst = [] | |
for smallstring in stringlist: | |
strlst.append(smallstring[1:-1]) |
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
//timestamp: [time difference from previous] message | |
34: [34µs] about to do this.each (jQuery.fn.each) | |
62: [28µs] entered this.each, about to do .attr and MathElement[] lookup | |
118: [56µs] done, there is a block! | |
122: [4µs] got cursor, about to do cursor.clearSelection() | |
130: [8µs] did cursor.clearSelection(), about to do block.renderLatex(latex) | |
139: [9µs] got jQ, about to empty except for textarea | |
554: [415µs] emptied jQ, about to delete children from edit tree | |
566: [12µs] appending cursor | |
795: [229µs] appended cursor, this.cursor.writeLatex() |
OlderNewer