Skip to content

Instantly share code, notes, and snippets.

<?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);
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
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\w\$(parse_git_branch) $ "
From 613a3b807e97629f99bbe5ce2b33da5fe85a1afe Mon Sep 17 00:00:00 2001
From: Colin Curtin <colin.t.curtin@gmail.com>
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