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
require "net/http" | |
require "enumerator" | |
# Example Usage: | |
# | |
# use Rack::Proxy do |req| | |
# if req.path =~ %r{^/remote/service.php$} | |
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}") | |
# end | |
# end |
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
/** | |
* Detect if the browser can play MP3 audio using native HTML5 Audio. | |
* Invokes the callack function with first parameter is the boolean success | |
* value; if that value is false, a second error parameter is passed. This error | |
* is either HTMLMediaError or some other DOMException or Error object. | |
* Note the callback is likely to be invoked asynchronously! | |
* @param {function(boolean, Object|undefined)} callback | |
*/ | |
function canPlayAudioMP3(callback){ | |
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
#!/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 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_girl for minitest | |
# | |
# Factory.define :user do |f| | |
# f.login 'johndoe%d' # Sequence. | |
# f.email '%{login}@example.com' # Interpolate. | |
# f.password f.password_confirmation('foobar') # Chain. | |
# end | |
# | |
# Factory.define :post do |f| | |
# f.user { Factory :user } # Blocks, if you must. |
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
# 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 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
# 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 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
/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 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/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 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/env bash | |
# File: twit_twurl.sh | |
# Description: Tweet from the command line using twurl & OAuth | |
# | |
# Copyright 2010 George Ornbo (Shape Shed) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
OlderNewer