Skip to content

Instantly share code, notes, and snippets.

@smith
smith / nodes.js
Last active December 27, 2015 07:09
An example of using chef-zero for integration testing chef-node
var spawn = require('child_process').spawn,
chef = require('../../chef'),
key = require('fs').readFileSync(__dirname + '/../fixtures/example.pem'),
expect = require('chai').expect;
describe('Nodes', function () {
before(function () {
var chefZero = this.chefZero = spawn('chef-zero', ['--port=8889']);
chefZero.on('exit', function (code, signal) {
if (code !== 0) { throw new Error('Chef Zero exited unexpectedly.'); }
@smith
smith / Notes On Strange Loop 2013.md
Last active December 23, 2015 17:09
Notes On Strange Loop 2013

Notes On Strange Loop 2013

The second Strange Loop I've attended was truly an amazing conference like no other. Last year's was fantastic, but this year was just, well, you really had to be there. Even so, I'll try to give a summary of stuff that happened.

Negatives

To get it out of the way now, these are the things I didn't like:

@smith
smith / requirejs.yml
Last active December 21, 2015 20:09
RequireJS setup of Tabby
shim:
jquery.textarea:
deps: [jquery]
paths:
jquery.textarea: jquery.textarea-0.12 # if you have vendor/assets/javascripts/jquery.textarea-0.12.js
# use with require('jquery.textarea')
@smith
smith / crest.txt
Last active December 16, 2015 08:19
Shryock Family Crest
+-----------+
| |
| ☜(゚ヮ゚☜) |
| |
| ౿(ఠ_ఠఎ) |
| |
| ಠ_ಠ |
x x
xx xxx
xx xx
[2013-03-24T22:00:44-05:00] DEBUG: Saving the current state of node mira.cramerdev.net
[2013-03-24T22:00:44-05:00] DEBUG: Signing the request as mira.cramerdev.net
[2013-03-24T22:00:44-05:00] DEBUG: String to sign: 'Method:PUT
Hashed Path:2mM6K+p/MNcRK9tuoNhmssqn/cU=
X-Ops-Content-Hash:V3QwYvbwyHEKl/7FxVsKyM55ysU=
X-Ops-Timestamp:2013-03-25T03:00:44Z
X-Ops-UserId:mira.cramerdev.net'
Header hash: {"X-Ops-Sign"=>"algorithm=sha1;version=1.0;", "X-Ops-Userid"=>"mira.cramerdev.net", "X-Ops-Timestamp"=>"2013-03-25T03:00:44Z", "X-Ops-Content-Hash"=>"V3QwYvbwyHEKl/7FxVsKyM55ysU=", "X-Ops-Authorization-1"=>"Nz+Gy1JRggw8ixZTWJfpN/drRuvVKqAnLNWX5+AD0vbJh5rOAR6JE7Vo3+95", "X-Ops-Authorization-2"=>"EQ6ToLwYjTn/E6UtMvWDtfmrFFmHlufwTRzg1QjXIOfqdNSNOC1esZaCcRRL", "X-Ops-Authorization-3"=>"xRGeMo7LkzFRtfCxlotG7e78DH9eYNhUZ8PEPF3ZFLDpfJ4qXaMuQBy+qQDM", "X-Ops-Authorization-4"=>"Q2jEL02XrRxwifOQn6o45hJgc0KwS/VbZaHP8bVPzJ96NaIKfpefAMVkw0e4", "X-Ops-Authorization-5"=>"zwDOvtWcujEPGJ++R+iGOrpnpmqh1B4oTrNqzfTuZ1NrV+KgadgJ6mXG/3Li",
@smith
smith / backup.rb
Created October 12, 2012 05:02
Backup Gem With Chef
# Example of what integration of the backup gem with chef could look like
backup 'my app' do
# The stuff here (taken from https://github.com/meskyanichi/backup) would be
# passed into the backup gem with class_eval or something. In a real recipe
# most of these variables would be replaced by
# node or other attributes, so:
#
# backup 'my app' do => Backup::Model.new(:"my app", 'my app') do...
split_into_chunks_of 4000
@smith
smith / gist:3297930
Created August 8, 2012 19:32
traceroute
smith@iNeXT:~$ traceroute www.vetrxdirect.com
traceroute: Warning: www.vetrxdirect.com has multiple addresses; using 199.27.135.185
traceroute to cf-ssl8760-protected-www.vetrxdirect.com (199.27.135.185), 64 hops max, 52 byte packets
1 10.0.54.254 (10.0.54.254) 0.894 ms 0.660 ms 0.616 ms
2 199-27-166-54.cramerit.net (199.27.166.54) 1.382 ms 1.339 ms 1.313 ms
3 10.42.253.1 (10.42.253.1) 8.455 ms 33.875 ms 7.023 ms
4 cdr2-edge-03.inet.qwest.net (67.128.222.145) 11.870 ms 26.649 ms 5.027 ms
5 cdr2-core-02.inet.qwest.net (205.171.163.21) 4.900 ms 10.118 ms 7.210 ms
6 63.146.26.230 (63.146.26.230) 14.301 ms 17.515 ms 26.155 ms
7 ae11.ar2.ord1.us.nlayer.net (69.31.111.210) 25.479 ms 16.099 ms 14.471 ms
@smith
smith / .bash_profile
Created June 7, 2012 03:44
Set editor to sublime text 2
# The path to the command line program that launches your editor
export EDITOR=/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl
@smith
smith / data.js
Created April 30, 2012 21:19
Data+bindings
// The elements on a page:
//
// $("[data-bind-domain]").map(function () { return $(this).attr("data-bind-domain") }); =>
[
"rank_value_3_months",
"pageviews_peruser_value_3_months",
"whois_server_name",
"whois_server_url",
"rank_value_3_months",
"rank_value_3_months_delta",
@smith
smith / index.html
Created April 4, 2012 04:46
Ping with socket.io
<input placeholder="ping something" /><button>ping!</button>
<pre></pre>
<script src="//localhost:8888/socket.io/socket.io.js"></script>
<script>
(function () {
var socket = io.connect("//localhost:8888"),
pre = document.querySelectorAll("pre")[0],
input = document.querySelectorAll("input")[0],
button = document.querySelectorAll("button")[0];