This file contains hidden or 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/ruby | |
| # Tested on OS X Leopard only but should work | |
| # for BSDs | |
| start = /\{ sec = ([0-9]+),/.match(`sysctl -n kern.boottime`).captures[0] | |
| uptime_secs = (Time.now.to_f - start.to_f).round | |
| def seconds_to_time(seconds) |
This file contains hidden or 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 | |
| usage() { | |
| cat <<-EOT | |
| usage: $0 [home|work] | |
| This script starts a Synergy server for home or work. | |
| EOT | |
| } |
This file contains hidden or 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
| try | |
| set the clipboard to (do shell script "pbpaste | /usr/local/bin/gist") | |
| end try |
This file contains hidden or 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
| --- LastFM - Ban Current Track | |
| set previousApp to name of (info for (path to frontmost application)) | |
| tell application "Last.fm" to activate | |
| tell application "System Events" to keystroke "b" using command down | |
| open location "x-launchbar:hide" | |
| tell application previousApp to activate |
This file contains hidden or 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
| function parse_git_branch | |
| { | |
| ref=$(git-symbolic-ref HEAD 2> /dev/null) || return | |
| echo " (${ref#refs/heads/})" | |
| } | |
| PS1="[\u@\h \W\$(parse_git_branch)]\\$ " |
This file contains hidden or 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
| Sure, you can ogle her <BODY> - stare at her <FORM>, but for crying out loud, use your <HEAD>! | |
| <A> woman doesn't want to be treated as an <OBJECT>. You've got to have <STYLE>. Work on | |
| your pickup lines, don't read from some <SCRIPT>. Be <BOLD>, and take chances! Make sure | |
| each <BUTTON> on your shirt is done up right. <SELECT> a nice cologne, but not too much! | |
| Follow these simple instructions, stay in the right <FRAME> of mind, and <I> am sure | |
| you'll soon be a <LEGEND> in dating. |
This file contains hidden or 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
| check out the git-update-index man page and the --assume-unchanged bit and related. | |
| when I have your problem I do this | |
| git update-index --assume-unchanged dir-im-removing/ | |
| or a specific file | |
| git update-index --assume-unchanged config/database.yml |
This file contains hidden or 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 | |
| usage() { | |
| cat <<-EOT | |
| usage: $0 options | |
| Options: | |
| -u Username | |
| -p Password |
This file contains hidden or 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
| mysql> describe contacts; | |
| +------------+---------------------+------+-----+---------+----------------+ | |
| | Field | Type | Null | Key | Default | Extra | | |
| +------------+---------------------+------+-----+---------+----------------+ | |
| | id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | |
| | user_id | bigint(20) unsigned | NO | | NULL | | | |
| | first_name | varchar(255) | YES | | NULL | | | |
| | last_name | varchar(255) | YES | | NULL | | | |
| | company | varchar(255) | YES | | NULL | | | |
| | address_1 | varchar(255) | YES | | NULL | | |
This file contains hidden or 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
| Factory.define :contact do |f| | |
| f.user_id 1 | |
| f.first_name 'Philip' | |
| f.last_name 'Fry' | |
| f.company 'Planet Express' | |
| f.address_1 '123 Some St' | |
| f.city 'New New York' | |
| f.state 'NY' | |
| f.zip 11999 | |
| f.home_phone 15186331111 |