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 datetime | |
import json | |
import urllib2 | |
import time | |
LAST_DAY = datetime.datetime(2010, 6, 30) | |
TODAY = datetime.datetime.now() | |
CALENDAR_API_URL = 'http://www.hanalani.org/api/calevents/range.json?cal=all-school-calendar' | |
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 scala.io.Source | |
if (args.length > 0) { | |
def formatSourcePrefix(line: Int, suffix: String, max: Int = 5): String = { | |
var prefix: String = "" | |
for (i <- 1 to (max - line.toString.length)) | |
prefix += " " | |
prefix + line.toString + suffix | |
} |
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
Version = 4 | |
Booleans = {'caretLineVisible': False, 'preferFixed': 1, 'useSelFore': True} | |
CommonStyles = {'attribute name': {'fore': 7872391}, | |
'attribute value': {'fore': 3100463}, | |
'bracebad': {'back': 9117943, 'bold': 1, 'fore': 16777215}, | |
'bracehighlight': {'bold': 1, 'fore': 16777215}, | |
'classes': {'bold': True, 'fore': 9117943}, | |
'comments': {'fore': 2696233, 'italic': 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
#!/usr/bin/env python | |
# | |
# Converts any PNG into pure HTML | |
# | |
import png, array | |
reader = png.Reader(filename='wedding.png') # << -- enter the image path here | |
width, height, pixels, metadata = reader.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
// -- FizzBuzz in Dart -- | |
void fbPrint(c) { | |
if (c % 15 == 0) { print ('FizzBuzz'); } | |
else if (c % 5 == 0) { print ('Buzz'); } | |
else if (c % 3 == 0) { print('Fizz'); } | |
else { print(c); } | |
} | |
void fbFlow(c) { |
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 choice(set, choice) { | |
return set.indexOf(choice) > -1 ? choice : ''; | |
} | |
function blankArray(l) { | |
return (new Array(l)).map(function(){ return ''; }); | |
} | |
Array.prototype.pairChoice = function(c) { |
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
var choose = function(a, b, teams) { | |
if (teams[a] && teams[b]) { | |
return teams[a] < teams[b] ? a : b; | |
} else if (teams[a]) { | |
return a; | |
} else if (teams[b]) { | |
return b; | |
} else { | |
return Math.random() < 0.5 ? a : b; | |
} |
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
<!DOCTYPE> | |
<html> | |
<body> | |
<script type="text/javascript"> | |
var base10 = { | |
increment: function(v) { | |
var incrementBit = function(bits) { | |
var b = bits[0]; | |
if (b == '0') { | |
bits.splice(0, 1, '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
# | |
# Slim Using Longhand (full tags) | |
# slim-lang.org | |
# | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Slim Examples</title> |
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 ruby | |
# | |
# Use: | |
# | |
# => cfl | |
# => cfl all | |
# => cfl last | |
# => cfl last 3 | |
# |