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
wget http://pear.php.net/go-pear.phar | |
php -d detect_unicode=0 go-pear.phar | |
export PATH=$HOME/pear/bin | |
pear config-set auto_discover 1 | |
pear install --alldeps pear.phpunit.de/PHPUnit | |
pear install phpunit/dbUnit phpunit/PHPUnit_Selenium phpunit/PHPUnit_Story |
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
require 'formula' | |
class Phpunit < Formula | |
homepage 'http://www.phpunit.de/manual/current/en/index.html' | |
url 'http://pear.phpunit.de/get/phpunit.phar' | |
sha1 '7aaa26086ddf7cd0c517d7f52b74a53a7a1d7e29' | |
version 'HEAD' | |
def install | |
bin.install "phpunit.phar" => "phpunit" |
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
# This hosts file is brought to you by Dan Pollock and can be found at | |
# http://someonewhocares.org/hosts/ | |
# You are free to copy and distribute this file, as long the original | |
# URL is included. See below for acknowledgements. | |
# Please forward any additions, corrections or comments by email to | |
# hosts@someonewhocares.org | |
# Last updated: Feb 17th, 2013 at 13:37 |
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
~ > history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head -20 | |
882 vim | |
702 git | |
466 cd | |
408 ack | |
241 gco | |
232 ls | |
218 rm | |
129 mv | |
100 rspec |
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
~ > node -e "console.log((0.1 + 0.2) + 0.3 == 0.1 + (0.2 + 0.3))" | |
false | |
~ > php -r "var_dump((0.1 + 0.2) + 0.3 == 0.1 + (0.2 + 0.3));" | |
bool(false) | |
~ > ruby -e "p (0.1 + 0.2) + 0.3 == 0.1 + (0.2 + 0.3)" | |
false | |
~ > python -c "print (0.1 + 0.2) + 0.3 == 0.1 + (0.2 + 0.3)" |
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 | |
# Usage: | |
# gfm <files> | |
# | |
# Examples: | |
# | |
# gfm README.markdown | |
# echo "# Test" | gfm | |
# echo "# Test" | gfm - README.markdown | |
# gfm |
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 | |
# | |
# Usage: rebundle gem_name | |
# | |
# The script will remove the gem dependency tree from the lockfile and bundle. | |
LOCKFILE_NAME = "Gemfile.lock" | |
lockfile = File.readlines(LOCKFILE_NAME) |
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
# Always raise errors when I18n translations are missing. To override this | |
# behavior: | |
# | |
# I18n.t :some_key, allow_missing: false | |
I18n.exception_handler = -> exception, locale, key, options do | |
if options.delete(:allow_missing) | |
I18n::ExceptionHandler.new.call(exception, locale, key, options) | |
else | |
raise I18n::MissingTranslationData.new(locale, key, options) | |
end |
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
class Struct | |
def to_hash | |
Hash[each_pair.to_a] | |
end | |
end |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |