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 ([email protected]) | |
# 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 |
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
batkin:asciidoc ben$ history | grep 'hg clone' | tail -n 1 | |
636 history | grep 'hg clone' | tail -n 1 | |
batkin:asciidoc ben$ history | grep 'hg clone' | tail -n 2 | |
636 history | grep 'hg clone' | tail -n 1 | |
637 history | grep 'hg clone' | tail -n 2 | |
batkin:asciidoc ben$ history | grep 'hg clone' | tail -n 4 | |
573 hg clone http://hg.sharesource.org/asciidoc/ | |
636 history | grep 'hg clone' | tail -n 1 | |
637 history | grep 'hg clone' | tail -n 2 | |
638 history | grep 'hg clone' | tail -n 4 |
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
class Monthly | |
def initialize(date = Date.today) | |
@date = date | |
end | |
def first | |
Date.civil(@date.year, @date.month, 1) | |
end | |
def last |
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
-- List all nvarchar and varchar columns in SQL Server database | |
SELECT OBJECT_NAME(col.OBJECT_ID) as [TableName], col.[name] as [ColName], typ.[name] | |
FROM sys.all_columns col | |
INNER JOIN sys.objects obj | |
ON col.object_id = obj.object_id | |
INNER JOIN sys.types typ | |
ON col.user_type_id = typ.user_type_id | |
WHERE col.user_type_id IN (167,231) | |
AND obj.type = 'U' | |
ORDER BY name, TableName, ColName |
OlderNewer