Skip to content

Instantly share code, notes, and snippets.

View newtonapple's full-sized avatar

David Dai newtonapple

  • Tobiko Data
  • San Francisco
View GitHub Profile
@newtonapple
newtonapple / gist:4122198
Created November 21, 2012 00:15
Campfire emoji bomb.
:+1: :-1: :8ball: :a: :ab: :airplane: :alien: :ambulance: :angel: :anger: :angry: :apple: :aquarius: :aries: :arrow_backward: :arrow_down: :arrow_forward: :arrow_left: :arrow_lower_left: :arrow_lower_right: :arrow_right: :arrow_up: :arrow_upper_left: :arrow_upper_right: :art: :astonished: :atm: :b: :baby: :baby_chick: :baby_symbol: :balloon: :bamboo: :bank: :barber: :baseball: :basketball: :bath: :bear: :beer: :beers: :beginner: :bell: :bento: :bike: :bikini: :bird: :birthday: :black_square: :blue_car: :blue_heart: :blush: :boar: :boat: :bomb: :book: :boot: :bouquet: :bow: :bowtie: :boy: :bread: :briefcase: :broken_heart: :bug: :bulb: :bullettrain_front: :bullettrain_side: :bus: :busstop: :cactus: :cake: :calling: :camel: :camera: :cancer: :capricorn: :car: :cat: :cd: :chart: :checkered_flag: :cherry_blossom: :chicken: :christmas_tree: :church: :cinema: :city_sunrise: :city_sunset: :clap: :clapper: :clock1: :clock10: :clock11: :clock12: :clock2: :clock3: :clock4: :clock5: :clock6: :clock7: :clock8: :clock9: :
@newtonapple
newtonapple / Facebook User Agent
Created July 10, 2012 20:47
FB & Twitter iPhone browser user agent.
Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.1.1;FBBV/4110.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/AT&T;FBID/phone;FBLC/en_US;FBSF/2.0]
@newtonapple
newtonapple / keyframe.css
Created April 25, 2012 09:24
CSS Keyframe Animation Syntax
/*
References:
http://css-tricks.com/snippets/css/webkit-keyframe-animation-syntax/
https://developer.mozilla.org/en/css/css_animations
Compatible with Firefox 5+, IE 10+, Chrome 6+, Safari 5+
*/
/* Declaration (add appropriate browser prefix accordinginly) */
@-webkit-keyframes animation-name {
@newtonapple
newtonapple / gist:2469589
Created April 23, 2012 08:32
The Tragedy of Hamlet, Prince of Denmark - Shakespeare homepage | Hamlet | Act 4, Scene 1
The Tragedy of Hamlet, Prince of Denmark
Hamlet | Act 4, Scene 1
SCENE I. A room in the castle.
Enter KING CLAUDIUS, QUEEN GERTRUDE, ROSENCRANTZ, and GUILDENSTERN
KING CLAUDIUS
There's matter in these sighs, these profound heaves:
You must translate: 'tis fit we understand them.
@newtonapple
newtonapple / top-level-domains.txt
Created March 18, 2012 03:51
list of top level domains
aero|asia|coop|jobs|info|mobi|name|travel|biz|cat|com|edu|gov|int|mil|org|pro|tel|xxx|ac|ae|af|ag|al|am|as|at|au|az|ba|be|bg|bi|bj|br|bt|by|bz|ca|cc|cd|ch|ck|cl|cn|co|co|cx|cy|cz|de|dk|dm|dz|ee|eg|es|eu|fi|fo|fr|gb|ge|gl|gm|gr|gs|hk|hm|hn|hr|hu|ie|il|in|iq|ir|is|it|je|jp|kg|kr|la|li|lt|lu|lv|ly|ma|mc|md|me|mk|ms|mt|mu|mx|my|net|nf|ng|nl|no|nu|nz|pl|pr|pt|ro|ru|sa|sb|sc|se|sg|sh|si|sk|sm|st|su|tc|tf|th|tj|tk|tl|tm|tn|to|tp|tr|tw|tv|tz|ua|uk|us|uy|uz|va|vc|ve|vg|ws|yu
@newtonapple
newtonapple / gist:1475282
Created December 14, 2011 04:37
Mash.rb
class Mash < Hash
def method_missing(name, *args, &block)
if args.size == 0
val = self[name.to_s]
if val.is_a?(Hash)
self.class[val]
else
val
end
else
@newtonapple
newtonapple / gist:1352741
Created November 9, 2011 19:52
Startups in 13 Sentences
Startups in 13 Sentences
One of the things I always tell startups is a principle I learned from Paul Buchheit: it's better to make a few people really happy than to make a lot of people semi-happy. I was saying recently to a reporter that if I could only tell startups 10 things, this would be one of them. Then I thought: what would the other 9 be?
When I made the list there turned out to be 13:
1. Pick good cofounders.
@newtonapple
newtonapple / gits.html
Created October 28, 2011 07:16
break yo js
'
'
@newtonapple
newtonapple / gist:1062819
Created July 4, 2011 02:16 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@newtonapple
newtonapple / Japan Twitpics
Created March 11, 2011 12:39
Generates an HTML with the latest 1000 twitpics from Japan. Useful for getting a glimpse of the Tsunami disaster in Japan. You'll need Ruby 1.9 & Yajl Ruby to run this.
#!/usr/bin/env ruby
# example: ruby twitpic_extractor.rb > japan.html
require 'uri'
require 'yajl/http_stream'
require 'zlib'
class Twitpic
class SimpleBloomFilter