Skip to content

Instantly share code, notes, and snippets.

View danbeaulieu's full-sized avatar

Dan Beaulieu danbeaulieu

View GitHub Profile
1.9.3p194 :022 > Money.new(1000, "USD").format(:with_currency => true)
=> "$10,00 USD"
end_date = Date.today + 7.days
if request[:end]
end_date = Date.parse(request[:end])
end
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@danbeaulieu
danbeaulieu / pre-commit.bash
Created May 3, 2012 18:28 — forked from brentsowers1/pre-commit.bash
Git pre-commit hook to prevent non-ascii characters
#!/bin/bash
# Save these contents to .git/hooks/pre-commit in your project
# folder, and give it executable permissions with
# "chmod u+x .git/hooks/pre-commit"
# Git will abort a commit if you have non ASCII characters in
# the commit, and output the non ASCII characters.
output=`git diff HEAD | grep ^+[^+] | tr -d "\000-\011\013-\177" | tr -d '\n'`
cnt=${#output}
if [ -n "$output" ]; then
@danbeaulieu
danbeaulieu / pre-commit.bash
Created May 3, 2012 18:28 — forked from brentsowers1/pre-commit.bash
Git pre-commit hook to prevent non-ascii characters
#!/bin/bash
# Save these contents to .git/hooks/pre-commit in your project
# folder, and give it executable permissions with
# "chmod u+x .git/hooks/pre-commit"
# Git will abort a commit if you have non ASCII characters in
# the commit, and output the non ASCII characters.
output=`git diff HEAD | tr -d "\000-\011\013-\177" | tr -d '\n'`
cnt=${#output}
if [ -n "$output" ]; then