Skip to content

Instantly share code, notes, and snippets.

View ELLIOTTCABLE's full-sized avatar
🐫

ELLIOTTCABLE

🐫
View GitHub Profile
@ELLIOTTCABLE
ELLIOTTCABLE / gist:23071104928d012ce9a4
Last active August 29, 2015 14:17
Letter of complaint to Butterfly Labs.
I (finally!) received my BFL order yesterday. http://ell.io/i18OtQ
I wire them up carefully, following the, er, completely lack of instructions provided? I verify that
the fans are working, first, before plugging in any of the actual cards, as the (single) sheet of
paper warns in all caps. They operate as-expected.
Really, the only instructions whatsoever on the single sheet of paper included, is, in all caps,
‘Butterfly Labs suggests *TWO* PCI power cables.’ Well, there's three PCI ports on each card.
Unlabeled. I have no idea *which* two that means I'm supposed to use. http://ell.io/i1a9pp
#env
LESS=-R
> ruby run.rb
Visit this URL: https://api.twitter.com/oauth/authorize?oauth_token=<snip>
Enter the PIN: <snip>
Access token: <snip>
Access token secret: <snip>
@ELLIOTTCVBLE: starting tweet stream
/Users/ec/.rvm/gems/ruby-2.2.0/gems/twitter-5.13.0/lib/twitter/streaming/response.rb:21:in `on_headers_complete': Twitter::Error::Unauthorized
from /Users/ec/.rvm/gems/ruby-2.2.0/gems/twitter-5.13.0/lib/twitter/streaming/response.rb:16:in `<<'
from /Users/ec/.rvm/gems/ruby-2.2.0/gems/twitter-5.13.0/lib/twitter/streaming/response.rb:16:in `<<'
from /Users/ec/.rvm/gems/ruby-2.2.0/gems/twitter-5.13.0/lib/twitter/streaming/connection.rb:22:in `stream'
@ELLIOTTCABLE
ELLIOTTCABLE / gist:3a945b04ed8170d710ac
Created February 10, 2015 15:55
POSIX-compatible shell-script truthiness-checking cheat-sheet with-a hyphenated-title
[ -n "${VAR##[NFnf]*}" ] && echo '$VAR must be truthy (but will be considered falsey by default, if empty)'
[ -z "${VAR##[YTyt]*}" ] && echo '$VAR must be truthy (and will be by default, if empty)'
[ -z "${VAR##[NFnf]*}" ] && echo '$VAR must be falsey (and will be by default, if empty)'
[ -n "${VAR##[YTyt]*}" ] && echo '$VAR must be falsey (but will be considered truthy by default, if empty)'
A) some-code, not some-one. Saying I want this to GTFO my code, where it inserted itself, is not
intended as a personal attack on you. That said, I think the invective is justified.
B) Yeah, the current version of the comment is definitely better. Looks like it was added via
`jitsu`, and it must have been long enough ago that the comment was the version @isaacs posts
above.
C) I suppose I could pull-request, but I'm not a (voluntary) user of your module; it's really not of
that much importance to me. I'm seconding a negative effect that another user of yours (@isaacs)
pointed out. That's all. /=
> sudo fdisk /dev/disk0
Disk: /dev/disk0 geometry: 121643/255/63 [1954210120 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 1954210119] <Unknown ID>
2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
#!/usr/bin/env sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
~function(){
// This script searches recent git commits' messages for [git labels][], and prints a list of labels
// to standard output, ordered by number of occurrences.
//
// Author: twitter.com/@ELLIOTTCABLE
//
// Usage:
var d = require('domain').create()
d.on('error', function(err){
if (err.code === 'EPIPE') return process.exit() })
d.add(process.stdin)
d.add(process.stdout)
d.enter()
@ELLIOTTCABLE
ELLIOTTCABLE / gist:7fac65d478a1ca56ac4c
Last active August 29, 2015 14:12
Smarter $0 for shell-scripts.
# Instead of ...
#
# SCRIPT=$0
# SCRIPTDIR=`dirname $0`
#
# ... use:
SCRIPT="$(
cd "$(dirname "${BASH_SOURCE[0]}")"
SCRIPT="$(basename "${BASH_SOURCE[0]}")"
LABELS=$(
ruby -0 -nle "$(
cat <<<'END_SCRIPT'
echo $_
END_SCRIPT
)"
)