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 'curb' | |
require 'yaml' | |
hosts = %w( | |
example.com | |
google.com | |
) |
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
# Remap prefix to ctrl-s - keeps ctrl-a free for start of line | |
set -g prefix C-s | |
unbind C-b | |
# Keep consistent with screen behavior | |
bind C-s last-window | |
bind C-d detach | |
bind C-c new-window | |
bind C-r source-file $HOME/.tmux.conf |
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
# Include this in your .irbrc | |
def unbundled_require(gem) | |
if defined?(::Bundler) | |
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last | |
if spec_path.nil? | |
warn "Couldn't find #{gem}" | |
return | |
end | |
spec = Gem::Specification.load spec_path |
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/zsh | |
function actual_path() { | |
if [ [ -z "$1" ] -a [ -d $1 ] ]; then | |
echo $(cd $1 && test `pwd` = `pwd -P`) | |
return 0 | |
else | |
return 1 | |
fi | |
} |
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
location / { | |
if ($uri ~* "/assets/.*-(.*)\..*") { | |
expires max; | |
add_header Cache-Control public | |
add_header Etag $1; | |
} | |
} |
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
# Allow open-uri to follow unsafe redirects (i.e. https to http). | |
# Relevant issue: | |
# http://redmine.ruby-lang.org/issues/3719 | |
# Source here: | |
# https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb | |
module OpenURI | |
class <<self | |
alias_method :open_uri_original, :open_uri | |
alias_method :redirectable_cautious?, :redirectable? |
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 95badf3776ce6a69bdff356649c7f345567c148c Mon Sep 17 00:00:00 2001 | |
From: David Kelso <david@kelso.id.au> | |
Date: Tue, 26 Apr 2011 14:44:09 -0700 | |
Subject: [PATCH] Update for 10.6. | |
--- | |
TerminalTabSwitching.xcodeproj/project.pbxproj | 4 ++-- | |
1 files changed, 2 insertions(+), 2 deletions(-) | |
diff --git a/TerminalTabSwitching.xcodeproj/project.pbxproj b/TerminalTabSwitching.xcodeproj/project.pbxproj |
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
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$.fn.myWidget = function(params) { | |
(function(console){ | |
if (!params.debug) console = { log: function(){} }; | |
console.log("Logging enabled!"); | |
})(console); |
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
ctrl-z | |
bg | |
touch /tmp/stdout | |
touch /tmp/stderr | |
gdb -p $! | |
# In GDB | |
p dup2(open("/tmp/stdout", 1), 1) | |
p dup2(open("/tmp/stderr", 1), 2) |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
swfobject.registerObject("swfobject_static", "9.0.115", "expressInstall.swf"); | |
</script> | |
</head> |