Skip to content

Instantly share code, notes, and snippets.

View EnriqueVidal's full-sized avatar
🤠
I know nothing

Enrique Vidal EnriqueVidal

🤠
I know nothing
View GitHub Profile
@smathy
smathy / .bash_profile
Created July 21, 2009 23:57
git and svn tracking prompt
current_git_branch() {
git_exists=`git branch 2>/dev/null | sed -ne'/^\* /s///p'`
if [[ "$git_exists" != "" ]]; then
if [[ "$git_exists" == "(no branch)" ]]; then
git_exists="\e[31m\]$git_exists\e[0m\]"
fi
echo "$git_exists "
fi
unset git_exists
@smathy
smathy / .ackrc
Last active September 3, 2015 22:25
Various config files for Rails, github, etc..
--type-add=ruby=.haml,sass=.sass
@smathy
smathy / Chapter 05.markdown
Created November 6, 2009 21:43
Learn to Program

Chapter 2

Each one builds on the previous, ie. I re-use constants defined earlier.

Hours in a year

HOURS_IN_DAY = 24
DAYS_IN_YEAR = 365.242199
HOURS_IN_YEAR = HOURS_IN_DAY * DAYS_IN_YEAR

puts "Hours in an astronomical year: #{HOURS_IN_YEAR}"

@iangreenleaf
iangreenleaf / funcs.sh
Created August 13, 2010 20:51
Git unsigned merge hook
function error_message {
echo -e >&2 \
"---------------------------------------------------------------------------------------------------------" \
"\n$1" \
"\n---------------------------------------------------------------------------------------------------------"
}
function undo_merge {
error_message "Undoing your merge. Please fix the problem and try again."
@iangreenleaf
iangreenleaf / .gitconfig
Created September 20, 2010 21:30
Better diffs in git
[diff "ruby"]
wordRegex = (@@?|\\b:|[^:]:)?[[:alnum:]_]+|:\"[^\"]+\"|::|[^[:space:]]
[diff "php"]
wordRegex = \\${0,2}[[:alnum:]_]+|::|->|[^[:space:]]
@smathy
smathy / devhosts
Created September 21, 2010 18:07
#!/usr/bin/env ruby
section_start = '## devstart -- section marker - do not touch'
section_end = '## devend -- section marker - do not touch'
ips = {
:vidal => '3.141',
:jose => '3.138',
:alejandro => '3.139',
:roberto => '3.140',
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@drnic
drnic / $
Created June 10, 2011 15:20
never fear $ in tutorials again
#!/usr/bin/env bash
"$@"
@tmcgilchrist
tmcgilchrist / gist:1103621
Created July 25, 2011 05:40
Rails 3 Setup for Oracle 10g XE

Notes on Setting up Oracle 10g XE with Rails

Capturing my notes about setting up an Oracle 10g XE / Rails environment for development work. Tested using the following versions, others may work as well:

  1. Ubuntu 11.04
  2. Ruby 1.9.2
  3. Rails 3
  4. Oracle 10 XE