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
require 'sinatra' | |
get '/' do | |
head = '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$("a").click(function(e) { | |
e.preventDefault(); | |
$.get($(this).attr("data")); | |
if ($(this).attr("data") == "pause") { |
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/python | |
import os | |
import sys | |
def listdir(d): | |
if not os.path.isdir(d): | |
print d | |
else: | |
for item in os.listdir(d): | |
listdir((d + '/' + item) if d != '/' else '/' + item) |
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 ruby | |
# wiki-scraper.rb by Jordan Scales | |
# http://jordanscales.com | |
# http://programthis.net | |
# | |
# Tests the idea that the first link on each wikipedia article | |
# will eventually lead to philosophy | |
# | |
# Usage: |
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
// ==UserScript== | |
// @name WikiBlue | |
// @description Removes strange blue overlay on Wikipedia | |
// @include http://en.wikipedia.org/* | |
// ==/UserScript== | |
// the guts of this userscript | |
function main() { | |
$('#mw-head-base').css('background-image', 'none'); |
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/python | |
# Zen-Coding clone by Jordan Scales - http://jscal.es | |
# 5/30/12 | |
# reference: http://whiletruecode.com/post/stop-hand-coding-start-zen-coding | |
# div>ul>li*5 | |
# expands to | |
# <div> | |
# <ul> |
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/python | |
import re | |
f = file('comments') | |
contents = f.read() | |
f.close() | |
chunks = contents.split('\n\n') | |
res = [] |
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
{ | |
"name": "Cleaver", | |
"author": { | |
"name": "Jordan Scales", | |
"twitter": "@prezjordan", | |
"url": "http://jscal.es" | |
}, | |
"description": "Hello World example!", | |
"slides": [ | |
{ |
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
-- Binary Tree Module | |
-- Jordan Scales | |
-- 2 November 2012 | |
module BinaryTree(BinaryTree(Node, EmptyTree), insert, height, arrayToBST, isLeaf, findMax, removeMax) where | |
-- we'll treat it as a `binary search tree` | |
data BinaryTree a = Node a (BinaryTree a) (BinaryTree a) | | |
EmptyTree | |
deriving (Show) |
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
-- Huffman Coding Module | |
-- by Jordan Scales | |
-- 4 November 2012 | |
module Huffman where | |
import BinaryTree | |
type Entry = ([Char], Integer) | |
type Dictionary = [(Char, [Char])] |
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
-- Complex Numbers Module | |
-- Jordan Scales (scalesjordan@gmail.com) | |
-- 21 November 2012 | |
module Complex where | |
-- Complex consists of a real and imaginary part | |
-- for our purposes, they are represented as /Floats/ | |
data Complex = Complex Float Float deriving (Eq, Show) |
OlderNewer