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
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.
@bru
bru / newpost.rb
Created December 25, 2009 16:33 — forked from jrk/newpost.rb
Creates a new Jekyll post, opens it in TextMate, and adds to the git index
#!/usr/bin/env ruby
require Dir
unless ARGV[0]
puts 'Usage: newpost "the post title"'
exit(-1)
end
blog_root = "/Users/jrk/proj/blog"
# Convert dec => hex and hex => dec
def decimal_to_hex(number)
res = number.to_i.to_s(16)
res = "0" * (12 - res.length) << res if res.length < 12
res
end
def hex_to_decimal(number)
"0x#{number}".hex
# Add the below to /etc/sudoers (use visudo as root)
# to allow `sudo apachectl [action]` without
# the need for a password
# Cmnd alias specification
Cmnd_Alias APACHECTL = /usr/sbin/apachectl
# User privilege specification
%admin ALL=NOPASSWD: APACHECTL
/path/to/rails_apps/*/log/*.log {
daily
missingok
rotate 30
compress
delaycompress
sharedscripts
postrotate
find /path/to/rails_apps/* -name tmp -maxdepth 1 -type d -exec touch {}/restart.txt \;
endscript
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
# Print the list of special characters used with strftime
def print_strftime_keys
now = Time.parse('2010-06-01')
('A'..'Z').to_a.each do |letter|
[letter, letter.downcase].each do |l|
time = now.strftime("%#{l}")
puts "'#{l}' => '#{time}'"
end
end
end
[alias]
# git browse
# Opens origin in web browser
#
# Ex:
# git@myhostname.com:my/repo.git => http://myhostname.com/my/repo
# git://myhostname.com/my/repo.git => http://myhostname.com/my/repo
# http[s]://myhostname.com/my/repo.git => http://myhostname.com/my/repo
browse = !open $( \
echo \"`git config remote.origin.url`\" | \
# Put this in app/metals/api.rb
require 'sinatra/base'
class Api < Sinatra::Base
before do
content_type :json
authenticate if api_request?
end
#
# Titanium Mobile Rake tasks
#
# Validate and launch your Titanium Mobile application via Rake
#
# Edit Application::COMPILER if not using OS X
# Requires jsl (install on OS X via homebrew with `brew install jsl`)
#
# Only supports iPhone right now.
#