This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum EntreeType : Int { | |
case Burrito, BurritoBowl, CrispyTacos, SoftTacos, Salad | |
} | |
enum Filling : Int { | |
case Chicken, Steak, Barbacoa, Carnitas, Sofritas, Veggie | |
var price : Int { | |
get { | |
switch self { | |
case .Chicken, .Sofritas, .Veggie { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s/expect(\([^)]*\)).to /\1.should / | |
s/eq(\([^)]\+\))/== \1/ | |
s/JSON.parse.*)$/\0.with_indifferent_access/ | |
s/\['\([^']\+\)'\]/[:\1]/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add ;0 to suppress long results, like a process or a mongoose connection | |
process;0 | |
// capture information from async calls. doesn't work on calls that use the arity. make a custom call for those. | |
var results = [], capture = function() { results.unshift([].slice.call(arguments)) } | |
// handle uncaught exceptions so a mistake in the console doesn't bounce you out of your session | |
process.on('uncaughtException', function(err) { console.log('***uncaught***', err); });0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert from 3 spaces to 4 spaces | |
cat test.py | unexpand -t 3 --first-only | expand -t 4 --initial | |
# requires GNU expand & unexpand | |
# on mac, run "sudo port install macports" & prefix unexpand/expand with a g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/helper' | |
class TestPost < Test::Unit::TestCase | |
def setup | |
end | |
def test_likes_babies | |
assert true | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BenJammin I consider you to be a developer (but not so much a programmer). | |
There needs to be a word for people who create (develop) apps/sites in | |
general. For me that word is developer. I don't consider programmer and | |
developer to mean the same thing. I don't consider either word to imply | |
competence. I wonder if there aren't other people who make the same | |
distinction between the two words. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $(dirname $(gem which git -q)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'sequel' | |
require 'optparse' | |
class Account | |
def initialize(name='') | |
pref_dir = File.expand_path('~/Library/Preferences') | |
db_file = Dir.glob("#{pref_dir}/TweetDeck*/*/*#{name}.db").first |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# odde (Optical Drive Disabler and Enabler) | |
# Ben Atkin (ben@benatkin.com) | |
# 2009-01-05 | |
# | |
# NO WARRANTY! | |
# | |
# Please only run this if you can grok the code. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults domains | ruby -e 'puts STDIN.readline.split(/,\s*/).join("\n")' | fgrep -i textmate |