Skip to content

Instantly share code, notes, and snippets.

@anamartinez
anamartinez / _localization.html.erb
Created January 22, 2014 21:53
Time zone select rails helper with formatted offset
<%= f.time_zone_select :time_zone, TimeZoneWithFormattedOffset.all.sort_by { |tz| [tz.now.utc_offset, tz.name] } %>
@anamartinez
anamartinez / How to...
Created November 29, 2012 19:39
Closure compilation
hello.* are the pre-compiled files
hi.* are the compiled files and how it should be use.
To compile use:
closure-library/closure/bin/build/closurebuilder.py --root=closure-library/ --root=myproject/ --namespace="myproject.sayHi" --output_mode=compiled --compiler_jar=compiler.jar
@anamartinez
anamartinez / mod_formula_mysql
Created October 29, 2012 05:18
Modified formula Mysql 5.1
require 'formula'
class Mysql51 < Formula
homepage 'http://dev.mysql.com/doc/refman/5.1/en/'
url 'http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/mysql-5.1.65.tar.gz'
sha1 '9af3740d0a9f3fb2a9423500dd298b423867cf6e'
depends_on 'readline'
fails_with :clang do
@anamartinez
anamartinez / bash_profile_git
Created October 6, 2012 03:07
Make your git promp look cool
git_prompt (){
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
fi
git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
if git diff --quiet 2>/dev/null >&2; then
git_color="\[\e[0;37m\]" # git clean
else
git_color="\[\e[0;31m\]" # git dirty
fi
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶