Skip to content

Instantly share code, notes, and snippets.

var Application = { // the module, a static wrapper
FXSPEED : 500, // a constant (sort of)
user : { // a nested static object
id : 123
},
toggle : function(){ ... }, // a static method
@caseyohara
caseyohara / index.html
Created September 18, 2011 06:46
TurfKit Demo markup and data
<!DOCTYPE html>
<html lang="en">
<head>
<title>TurfKit - Demo</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<link rel="stylesheet" href="/lib/turf/turfkit.css" type="text/css" />
<script src="/lib/turf/turfkit.js"></script>
@caseyohara
caseyohara / reserved_usernames.rb
Created December 9, 2011 22:58
A list of reserved usernames to avoid vanity URL collision with resource paths
# A list of possible usernames to reserve to avoid
# vanity URL collision with resource paths
# It is a merged list of the recommendations from this Quora discussion:
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
# Country TLDs found here:
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
# Languages found here:
@caseyohara
caseyohara / arrays.js
Created June 26, 2012 01:29
rmurphey/js-assessment answers
if (typeof define !== 'function') { var define = require('amdefine')(module); }
define(function() {
return {
indexOf : function(arr, item) {
for (var i = 0, total = arr.length; i < total; i++) {
if (arr[i] == item)
return i;
}
return -1;
@caseyohara
caseyohara / most_used_commands.txt
Last active July 26, 2016 20:19
My most used shell commands
~ $ history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30
1191 git status
446 ls
316 git push origin
288 git diff
250 git branch
248 git commit -m
234 rspec spec
213 ghi
180 m .
module Etc
def collect
result = []
self.each do |elem|
result << yield(elem)
end
return result
@caseyohara
caseyohara / example.md
Created February 26, 2014 03:38
Dual backgrounds on FontAwesome social icons

http://f.cl.ly/items/2R3i2r462B3V422K2H1e/Screen%20Shot%202014-02-25%20at%208.30.57%20PM.png

.fa-twitter-square,
.fa-facebook-square {
  position: relative;
  z-index: 0;
}

Keybase proof

I hereby claim:

  • I am caseyohara on github.
  • I am caseyohara (https://keybase.io/caseyohara) on keybase.
  • I have a public key whose fingerprint is E1D4 255C 1D3E 8141 666F 9FA3 5CE5 217B 851A 330A

To claim this, I am signing this object: