Skip to content

Instantly share code, notes, and snippets.

View dstokes's full-sized avatar

Drew Stokes dstokes

View GitHub Profile
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
var styles =
{ padding: '4px'
, width: '100%'
, textAlign: 'center'
, position: 'absolute'
, background: '#BADA55'
, borderBottom:'solid 1px #666'
, opacity: '0.5'
};
@dstokes
dstokes / gist:3651554
Created September 6, 2012 05:13
Tmux Battery Indicator

Battery indicator for the tmux status line (add to ~/.tmux.conf)

Displays the charge percentage and a unicode lightning bolt when the battery is charging. Makes use of the pmset command for battery information.

Tested on MacOSX Mountain Lion

set -g status-right "batt: #(pmset -g batt | awk 'NR==2 {gsub(/;/,\"\"\\); \
 print (match($3,/^ch/\\) ? \"\⚡ \":\"\"\\) $2}') | %h-%d %H:%M "
{
"sites": [
{ "url": "thing.com", "selector": ".selector" },
{ "url": "other.thing.com", "selector": ".selector" },
]
}
---
- hosts: all
sudo: yes
vars:
- nodejs_version: 0.10.20
tasks:
- name: Install node / npm depencencies
apt: pkg={{ item }} state=present
@dstokes
dstokes / functions.sh
Created January 24, 2014 17:15
NPM failover in bash
# description:
# implement npmjs registry failover in your shell
#
# setup:
# npm install -g npm-delegate
#
# usage:
# npms install through
# npms i through async
#
Transactions: 2715 hits
Availability: 100.00 %
Elapsed time: 19.44 secs
Data transferred: 0.00 MB
Response time: 1.98 secs
Transaction rate: 139.66 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 277.06
Successful transactions: 2715
Failed transactions: 0
-39
-0.058122206479310996
0.00009591925481799989
0.00010129759903065859
0.00017720440519042319
0.000202834460651502
0.00020609548664651817
0.00026041668024845427
0.0002744492376223206
0.0002841196255758404
WSDL
!
"addition"
"custom
"division"
"example"
"example"config
"expample"
"fibonacci"]acl
"fibonacci"]captcha
@dstokes
dstokes / keybase.md
Last active December 16, 2015 17:20

Keybase proof

I hereby claim:

  • I am dstokes on github.
  • I am dstokes (https://keybase.io/dstokes) on keybase.
  • I have a public key whose fingerprint is 5AF3 1446 D443 86E7 60BC F4F2 ED91 6D50 A59A CE74

To claim this, I am signing this object: