Skip to content

Instantly share code, notes, and snippets.

View jeremyckahn's full-sized avatar

Jeremy Kahn jeremyckahn

View GitHub Profile
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@paulirish
paulirish / rAF.js
Last active January 6, 2026 14:22
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@blake8086
blake8086 / twitter.js
Created November 17, 2011 23:13
Simple node.js server to stream Twitter 'Spritzer' level stream to client browser
global.server = require('http').createServer(function(request, response) {
global.twitterFeed = require('https').get({
auth: 'username:password',
host: 'stream.twitter.com',
path: '/1/statuses/sample.json',
}, function(res) {
res.setEncoding('utf8');
response.writeHead(200, 'text/plain');
res.on('data', function(chunk) {
response.write(chunk);

I click a link in Facebook or Twitter, I don't care about the URL. I care about content.

Sure, that link points to a URL, but I don't know what it is, and I'll never remember it. It could even be a really sensible URL, like http://odopod.com/blog/hack-days-2011-coming-november/ — but I still won't remember it. URLs are implementation details for content on the web, not content in themselves.

People want to share. They're probably doing it with Facebook or Twitter. Being able to share a link to content isn't dependent on a native or non-native experience, it's neutral. Even if your native app had a URL bar, you wouldn't want to copy and paste that into a thing and send that thing to someone, you want to press share and press a person.

Look, I love web apps — I even build one for a living! But users consistently appreciate native apps on iPhone (this doesn't apply to Android) because of the constraints of the HIG and the SDK.

@millermedeiros
millermedeiros / .vimrc
Last active September 27, 2025 02:50
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ...
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
@tdreyno
tdreyno / equivs.txt
Created September 12, 2011 00:51 — forked from jeremyckahn/equivs.txt
Equivalent JS and CoffeeScript functions?
getSpeedySignature: (ofString) ->
sum = 0
for i in [0..ofString.length]
sum += ofString.charCodeAt(i)
sum
@jeremyckahn
jeremyckahn / .vimrc
Created September 8, 2011 06:10
.vimrc
syntax enable
set number
set hlsearch
set incsearch
set nocp
set autoindent
set expandtab
set shiftwidth=4
set softtabstop=4
cnoreabbr nt NERDTree
@jeremyckahn
jeremyckahn / osx.sh
Created June 6, 2011 01:46
Useful OS X BASH commands
# Disable Spaces animation
# /via http://hints.macworld.com/article.php?story=20110214074550501
defaults write com.apple.dock workspaces-swoosh-animation-off -bool YES && killall Dock
# ... And re-enable.
defaults delete com.apple.dock workspaces-swoosh-animation-off && killall Dock
@mattmanning
mattmanning / drugwars.txt
Created June 1, 2011 16:09
Drugwars for the TI-82/83/83+ Calculators
Lbl G
ClrHome
Disp " J.M.'S DRUGWAR"," SIMULATION",""," VERSION 2.00",""," JUST SAY NO."
2000→Z
5000→Y
0→V
100→K
1→B
2→N
0→I
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php