Skip to content

Instantly share code, notes, and snippets.

🤘
clickity clack

Joshua Priddle itspriddle

🤘
clickity clack
Block or report user

Report or block itspriddle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View factory_girl_profiler.rb
# Run tests with `PROFILE_FG=1 [rake|rspec]` to profile FactoryGirl
#
# Example output:
#
# **Class** | **create** | **build** | **attributes_for**
# --------- | ---------- | --------- | ------------------
# **Total** | **11** | **0** | **0**
# Post | 5 | 0 | 0
# Author | 3 | 0 | 0
# User | 3 | 0 | 0
View Copy UUID to clipboard.scpt
#!/usr/bin/env osascript
-- Copy a UUID to the clipboard
set the clipboard to do shell script "uuidgen | tr -d '\n'"
View fuzzy_uptime.rb
#!/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)
View parse_sdp_packet.php
<?php
function parse_sdp($packet = '')
{
$out = array();
$lines = explode("\n", $packet);
foreach ($lines as $l)
{
$l = trim($l);
View twitter.rb
# Create a ~/.twitter/credentials.yml file.
# Example:
# name: twittername
# password: password
require 'rubygems'
require 'rest_client'
path = File.join(File.join(ENV['HOME'], ".twitter"), "credentials.yml")
user = YAML::load_file(path)
View gist:88109
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert
# allow ctrl/alt + arrow keys to work
"\e[5C": forward-word
View gist:91536
# bash_completion - programmable completion functions for bash 3.x
# (backwards compatible with bash 2.05b)
#
# $Id: bash_completion,v 1.872 2006/03/01 16:20:18 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
View DefaultKeyBinding.dict
{
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
}
/*
Add to ~/Library/KeyBindings/DefaultKeyBinding.dict
Create the directory if it does not exist
View setup_rails_git_ignores.sh
echo '.DS_Store' >> ./.gitignore
echo '*.swp' >> ./.gitignore
echo 'config/database.yml' >> ./.gitignore
echo 'config/mailer.yml' >> ./.gitignore
echo '*.sql' >> ./.gitignore
echo 'index/' >> ./.gitignore
echo 'public/system' >> ./.gitignore
echo 'public/tmp/' >> ./.gitignore
echo '[^.]*' > ./log/.gitignore
View gist:94287
#!/bin/bash
usage() {
cat <<-EOT
usage: $0 [home|work]
This script starts a Synergy server for home or work.
EOT
}
You can’t perform that action at this time.