Skip to content

Instantly share code, notes, and snippets.

View jwhitley's full-sized avatar
🏝️
balearic

John Whitley jwhitley

🏝️
balearic
View GitHub Profile
==> Downloading http://downloads.sourceforge.net/sourceforge/streamripper/streamripper-1.64.6.tar.gz
File already downloaded in /Users/whitley/Library/Caches/Homebrew
/usr/bin/tar xf /Users/whitley/Library/Caches/Homebrew/streamripper-1.64.6.tar.gz
==> ./configure --prefix=/opt/hb/Cellar/streamripper/1.64.6 --disable-debug --disable-dependency-tracking
./configure --prefix=/opt/hb/Cellar/streamripper/1.64.6 --disable-debug --disable-dependency-tracking
checking for a BSD-compatible install... /opt/hb/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/hb/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
@jwhitley
jwhitley / rjs_driver.js
Created March 28, 2012 20:41
r.js driver script w/ optimize: none
//Load the requirejs optimizer
var requirejs = require('/Users/whitley/src/requirejs-rails/bin/r.js'),
//Set up basic config, include config that is
//common to all the optimize() calls.
basConfig = {
"baseUrl": "/Users/whitley/tmp/wombat/tmp/assets",
"optimize": "none",
"paths": {
"d3": "d3.v2"
}
@jwhitley
jwhitley / rake.log
Created April 2, 2012 23:41
zenweb 3.0.0b1 error on example-site
** Invoke default (first_time)
** Invoke generate (first_time)
** Execute generate
unknown file type: config.ru
unknown file type: Gemfile
unknown file type: Gemfile.lock
unknown file type: rake.log
** Invoke extra_wirings (first_time)
** Execute extra_wirings
** Invoke site (first_time)
@jwhitley
jwhitley / IR_Black.itermcolors
Created June 3, 2012 03:46
IR_Black color scheme for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.31090480089187622</real>
<key>Green Component</key>
<real>0.31097450852394104</real>
@jwhitley
jwhitley / custom.rb
Created June 22, 2012 07:14
Sample VM user-customization Chef recipe
include_recipe "git"
%w{ vim zsh }.each { |p| package p }
bash "Set vagrant's shell to zsh" do
code <<-EOT
chsh -s /bin/zsh vagrant
EOT
not_if 'test "/bin/zsh" = "$(grep vagrant /etc/passwd | cut -d: -f7)"'
end
@jwhitley
jwhitley / git-embargo
Created October 4, 2013 20:03
git-embargo
#!/usr/bin/env zsh
# This is a utility wrapper around git update-index used to mark, unmark, and
# list files that are marked with the assume-unchanged bit. See `git help
# update-index` for details.
#
# Usage:
# git embargo <FILE> # Mark a file as embargoed -- changes won't appear in status
# git embargo -r <FILE> # Remove the embargo
# git embargo -l|--list # List all embargoed files
set deviceID to (do shell script "diskutil list | awk '/YourBootcampPartition/ {print $NF}'")
do shell script "sudo bless -device /dev/" & deviceID & " -legacy -setBoot -nextonly"
tell application "Finder" to restart
@jwhitley
jwhitley / ssh_config_for_vagrant
Created February 11, 2015 17:56
Convenience SSH host config for Vagrant VMs
Host vagrant
User vagrant
HostName 127.0.0.1
Port 2222
Compression yes
PubkeyAuthentication yes
LogLevel FATAL
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentitiesOnly yes
#!/bin/sh
git -c color.status=always status -s | sed "1s/^/$*\\
/"
@jwhitley
jwhitley / ArraySlice+SetBytes.swift
Created December 24, 2016 02:16
Swift 3 ArraySlice setBytes extension
import Foundation
extension ArraySlice {
// Overwrites the ArraySlice region with the passed-in array of bytes
mutating func setBytes(_ from: [UInt8]) {
var fromIter = from.makeIterator()
self.withUnsafeMutableBytes { bytes in
for i in stride(from: bytes.startIndex, to: bytes.endIndex - 1, by: 1) {
if let fromByte = fromIter.next() {
bytes[i] = fromByte