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
/* Extend jQuery with functions for PUT and DELETE requests. */ | |
function _ajax_request(url, data, callback, type, method) { | |
if (jQuery.isFunction(data)) { | |
callback = data; | |
data = {}; | |
} | |
return jQuery.ajax({ | |
type: method, | |
url: 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
iab <expr> ddate strftime("%c") | |
iab <expr> ttime strftime("%H:%M") | |
iab <expr> ptime strftime("%l:%M %p") |
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
# time how long it takes to load your website 100 times and save it to "non_cached.txt" | |
for i in {1..100} | |
do | |
time (curl http://www.yourwebsite.com > /dev/null 2> /dev/null) 2>> non_cached.txt | |
done | |
# Set up caching or whatever performance tweaks you need, then run it again (saving to different file) | |
for i in {1..100} | |
do | |
time (curl http://www.yourwebsite.com > /dev/null 2> /dev/null) 2>> cached.txt |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |
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
# From Scott Wheeler: http://blog.directededge.com/2010/06/05/using-taps-without-running-a-taps-server/ | |
# Tunnels the connections over SSH, initiates a pull from the production side, then kills the Taps server. | |
# Saved for posterity | |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'active_support/secure_random' | |
require 'net/ssh' | |
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
" File: .vim/syntax/rdoc.vim | |
" RDoc inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment | |
" ------------ _____________________ --------------------------- ________________________ ----------------- __ | |
syntax match rdocInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/ | |
HtmlHiLink rdocInlineURL htmlLink |
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 a UTC date to a EST date, factoring in DST | |
# GNU time | |
$ TZ=America/New_York date -d "Sep 19 04:58 UTC" | |
Sun Sep 19 00:58:00 EDT 2010 | |
# BSD time (equivalent to above) | |
$ TZ=America/New_York date -j -f "%b %d %R %Z" "Sep 19 04:58 GMT" "+%b %d %R %Z %Y" | |
Sep 19 00:58 EDT 2010 |
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
((fn [s] (print (list s (list (quote quote) s)))) (quote (fn [s] (print (list s (list (quote quote) s)))))) |
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
20,26d19 | |
< # Capture any arguments | |
< QUOTED_ARGS="" | |
< while [ "$1" != "" ] ; do | |
< QUOTED_ARGS="$QUOTED_ARGS \"$1\"" | |
< shift | |
< done | |
< | |
33c26 | |
< exec java $JAVA_OPTS -jar "$LAUNCHJAR" $QUOTED_ARGS |
OlderNewer