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
if RUBY_PLATFORM == 'java' | |
class Gem::Version # oddity | |
class << self | |
alias orig_correct? correct? | |
def correct?(version) | |
orig_correct? version.sub(/-?java$/, '') | |
end | |
end | |
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
# bench() - (C) 2010 [email protected] - MIT License | |
# | |
# Useful bench() routine for your .irbrc | |
# | |
# Usage: | |
# | |
# bench { some code } | |
# 1000 iterations: 1.205242 (0.000121 per iteration) | |
# bench(4939) { some code } | |
# 4939 iterations: 1.420919 (0.000288 per iteration) |
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
# http://gist.github.com/301471 | |
# | |
# Not Found - (C) 2010 [email protected] - MIT License | |
# | |
# Quick hack to have a string that always says "not found", | |
# even when multiple methods are chained to it. | |
# | |
# | |
# E.g.: | |
# |
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 YourApp | |
# This module fixes the double-port bug in generated URIs by an application | |
# running on a non-standard port (80 / 443). | |
# - [email protected] | |
# | |
# Ref: https://rails.lighthouseapp.com/projects/8994/tickets/1106-rewrite_url-adds-port-twice | |
# | |
module RewriterPatch | |
def self.included(rewriter) |
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
// ==UserScript== | |
// @name Facebook Purity - Removes annoying quiz and application messages from your facebook homepage | |
// @namespace http://steeev.freehostia.com | |
// @description Removes messages posted by applications to your facebook homepage | |
// @include http://www.facebook.com/* | |
// @include http://www.new.facebook.com/* | |
// @version 1.54b - 24th June 2009 | |
// ==/UserScript== | |
// UPDATES |
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
.*.sw? | |
verify-cn |
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
# Authlogic MD5 - Crypt crypto provider | |
# (C) 2009 [email protected] - MIT License | |
# Requires ruby facets (http://facets.rubyforge.org) | |
# | |
require 'facets/crypt' | |
module Authlogic | |
module CryptoProviders | |
class MD5Crypt | |
class << self |
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
// ==UserScript== | |
// @name Remove All Facebook Ads | |
// @author http://joshdick.net/programs | |
// @version 1.4 | |
// @namespace http://userscripts.org/scripts/show/13787 | |
// @description Removes any and all ads from Facebook. | |
// @include *facebook.com* | |
// ==/UserScript== | |
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
# ActiveRecord helper to manage an integer `status` column using Ruby :symbols. | |
# (C) 2009 Marcello Barnaba <[email protected]> - Released under the terms of the MIT License | |
# http://sindro.me/ | |
# | |
# == Usage == | |
# | |
# [REQUIRED] Put this file in lib/ | |
# [OPTIONAL] Fork this gist | |
# [OPTIONAL] Pluginize it | |
# [OPTIONAL] Write some tests |
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/bash | |
# Database Dump utility for MySQL. Put in cron like this: | |
# | |
# DUMPDIR='/home/example/DatabaseDumps' USER='dbuser' PASS='dbpass' DB='dbname' /path/to/dumpdb.sh | |
# | |
# (C) 2009 [email protected] | |
# | |
[ -z "$MAXAGE" ] && MAXAGE=744 |