I hereby claim:
- I am alexyoung on github.
- I am alexyoung (https://keybase.io/alexyoung) on keybase.
- I have a public key whose fingerprint is 620E 32D7 402D A626 1DFB D437 4B84 C8F8 8B53 67E2
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
SESSION=tlol | |
tmux set -g default-shell /bin/bash | |
tmux set -g default-command /bin/bash | |
tmux new-session -d -s $SESSION | |
tmux send-keys "/usr/local/bin/sl" C-m C-d |
#!/usr/bin/env sh | |
ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%.2f%%\n", $10/$5 * 100)}' |
gapi = {}; | |
gapi.client = { | |
load: function(path, version, cb) { | |
cb(); | |
}, | |
oauth2: { | |
userinfo: { | |
get: function() { | |
return { | |
execute: function(cb) { |
" vim:fdm=marker | |
" Editor basics {{{ | |
" Behave like Vim instead of Vi | |
set nocompatible | |
" Show a status line | |
set laststatus=2 | |
" Show the current cursor position |
#!/usr/bin/env bash | |
tput civis | |
tput setab 255 | |
tput clear | |
./vpad.sh 7 | |
tput setaf 35 | |
figlet -w `tput cols` -c -f roman "UNIX" | |
./center.sh "LIVE FREE OR DIE" | |
read -s | |
tput sgr0 |
Ext.ux.SchemaGrid = Ext.extend(Ext.grid.GridPanel, { | |
initComponent: function() { | |
var me = this, | |
schema = me.initialConfig.schema, | |
fields = schema.fields, | |
id = Ext.id(); | |
var store = new Ext.data.JsonStore({ | |
root: 'list', |
my-project/ | |
Makefile (run tests) | |
index.js (require app.js and start it listening on a port) | |
package.json (include dependencies and devDependencies, package.json isn't just for publishing to npm) | |
lib/ | |
app.js (Set up your Express app, assuming it's Express of course. You could do var User = require('models').User) | |
controllers/ | |
users.js | |
models/ | |
index.js (do exports.User = require('./user'); for each model) |
publishdocs: | |
$(eval PARENT_SHA := $(shell git show-ref -s refs/heads/gh-pages)) | |
$(eval DOC_SHA := $(shell git ls-tree -d HEAD docs | awk '{print $$3}')) | |
$(eval COMMIT := $(shell echo "Auto-update docs." | git commit-tree $(DOC_SHA) -p $(PARENT_SHA))) | |
@git update-ref refs/heads/gh-pages $(COMMIT) |
Production Tear Down: How Does Flickr Handle Loading Scripts Asynchronously?
If you are using an async loader, or even if you are just putting your scripts at the bottom of your DOM, you have a problem. In some cases your scripts will load after the user has clicked on something that requires a JavaScript function to handle the click. It's possible you have a pure HTML version, but if the user has JavaScript we want them to use it, even if the JavaScript hasn't loaded yet. You need some way of handling events before all of your assets have finished loading.
There are a number of ways we could do this, but it's helpful to look at a working implementation. This is going to be a two part series. First, we are going to look at how Flickr does this. In the second part, we can take the code that Flickr uses and extract the main features so that anyone can use the code.
In all of the code that Flickr loads before the body this is the part that matters to us: [Isolated actionQueue Code](https://gist.github.com/139