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
<?php | |
// put together the requested (current) URL | |
$current_url = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' | |
. $_SERVER['HTTP_HOST'] | |
. $_SERVER['REQUEST_URI']; | |
// encode it for use in the src parameter | |
$current_url = rawurlencode($current_url); |
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
module Enumerable | |
# Iterate over this array randomly. | |
# From: http://stackoverflow.com/questions/2459913/how-can-i-randomly-iterate-through-a-large-range | |
# And: http://refactormycode.com/codes/40-is_prime | |
def randomized | |
return to_enum(:randomized) unless block_given? | |
def is_prime?(num) | |
i = 3 |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1="\w\$(parse_git_branch) $ " |
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
From 613a3b807e97629f99bbe5ce2b33da5fe85a1afe Mon Sep 17 00:00:00 2001 | |
From: Colin Curtin <[email protected]> | |
Date: Fri, 22 Jan 2010 08:30:27 -0800 | |
Subject: [PATCH] Make mount available in Object scope. | |
--- | |
lib/sinatras-hat/extendor.rb | 1 + | |
1 files changed, 1 insertions(+), 0 deletions(-) | |
diff --git a/lib/sinatras-hat/extendor.rb b/lib/sinatras-hat/extendor.rb |