Skip to content

Instantly share code, notes, and snippets.

View itspriddle's full-sized avatar
🤘
clickity clack

Joshua Priddle itspriddle

🤘
clickity clack
View GitHub Profile
#!/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)
#!/bin/bash
usage() {
cat <<-EOT
usage: $0 [home|work]
This script starts a Synergy server for home or work.
EOT
}
try
set the clipboard to (do shell script "pbpaste | /usr/local/bin/gist")
end try
--- 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
function parse_git_branch
{
ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
echo " (${ref#refs/heads/})"
}
PS1="[\u@\h \W\$(parse_git_branch)]\\$ "
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.
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
#!/bin/bash
usage() {
cat <<-EOT
usage: $0 options
Options:
-u Username
-p Password
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 | |
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