An example of a famo.us lightbox widget. The lightbox flips between thumbnail and detail view when an item is clicked. Edit the grid layout using the sliders. Animations are powered by both easing curves and physics animations.
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 Data.Maybe | |
import Data.Char (toLower) | |
wds = zip "pvwdgazxubqfsnrhocitlkeymj" ['a'..'z'] | |
translate x = case lookup x wds of | |
Nothing -> x | |
Just v -> v | |
main = putStrLn (map translate "Wxgcg txgcg ui p ixgff, txgcg ui p epm. I gyhgwt mrl lig txg ixgff wrsspnd tr irfkg txui hcrvfgs, nre, hfgpig tcm liunz txg crt13 ra 'ixgff' tr gntgc ngyt fgkgf.") |
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 'net/http' | |
require 'uri' | |
require 'nokogiri' | |
url = URI.parse('http://webapps.cityofchicago.org/healthinspection/inspectionresultrow.jsp') | |
request = Net::HTTP::Post.new(url.path) | |
request.set_form_data({"REST"=>" ", "STR_NBR"=>"", "STR_NBR2"=>"", "STR_DIRECTION"=>"", "STR_NM"=>"", "ZIP"=>""}) |
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
var fs = require('fs'), | |
http = require('http'); | |
var Promise = function(values) { | |
this._callbacks = []; | |
this._errbacks = []; | |
if (arguments.length > 0) { | |
this.fulfill.apply(this, values); | |
} | |
} |
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 | |
#coding=utf-8 | |
import sqlite3 | |
import os | |
from lxml import etree | |
def get_notes(ever_enex): | |
'''extract notes from .enex file''' | |
content = open(ever_enex, 'r').read() |
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
#1 | |
'(.+?)\{([\s\S.]+?)\}' | |
#2 | |
'([\n\r\t\s\S]*?)(([\t\n])[a-zA-Z-]+?):(.+);([\n\t\s\S]*?)' | |
#3 | |
'([\s]*?)([-]*?)([0-9]+)' |
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/bash | |
cat all.json | | |
# curl 'http://www.khanacademy.org/api/v1/videos/localized/all' | | |
jq -r ' | |
[ | |
.[] | | |
{ | |
title, | |
en_id:.youtube_ids["en"], |
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
var callA = function (callback) { | |
setTimeout(function () { | |
callback({name: "a", data: "I am result A"}); | |
}, Math.round(Math.random() * 300)); | |
}; | |
var callB = function (callback) { | |
setTimeout(function () { | |
callback({name: "b", data: Math.round(Math.random() * 300)) % 2 === 0}); | |
}, Math.round(Math.random() * 300)); |
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 python | |
# coding:utf-8 | |
import _env | |
from time import time | |
from urllib import urlencode | |
from urllib2 import urlopen as urlopen2 | |
from urlparse import parse_qsl | |
from hashlib import md5 | |
from urlgrabber import urlopen | |
import errno |
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 randomColor(){ | |
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")"; | |
} | |
function showBoxes(window) { | |
var rects = []; | |
function getRects(node){ | |
var range = window.document.createRange(); | |
range.setStartBefore(node); | |
range.setEndAfter(node); |
OlderNewer