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
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 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 Dir | |
unless ARGV[0] | |
puts 'Usage: newpost "the post title"' | |
exit(-1) | |
end | |
blog_root = "/Users/jrk/proj/blog" |
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 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 |
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
# 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 |
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
/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 |
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/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. |
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
# 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 |
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
[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`\" | \ |
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
# Put this in app/metals/api.rb | |
require 'sinatra/base' | |
class Api < Sinatra::Base | |
before do | |
content_type :json | |
authenticate if api_request? | |
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
# | |
# 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. | |
# |
OlderNewer