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
alias spot='mdfind -onlyin `pwd`' |
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
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/1333785) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
echo "Installing ruby-debug with ruby-1.9.3-p125 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem |
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
# Created By Ramiro Jr. Franco for Crowdcompass | |
# http://ramiro.mx || http://www.crowdcompass.com | |
# Requires Modernizr with placeholder support - http://www.modernizr.com | |
# | |
# Essentially, I wanted a way to keep the nice <labels> in markup, but apply the | |
# placeholder styles in all browsers. This has been tested with FF 6+, Chrome 14+, | |
# IE7,8,9, and Safari 4+. When a browser does support the HTML5 placeholder it just | |
# kills the label and applies the placeholder attribute based on the Label text, | |
# otherwise it actually applies a method to the input to switch out the the value on | |
# focus / blur. For passwords it hides/shows a separate input field to retain |
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 Character < ActiveRecord::Base | |
has_many :weapons | |
end | |
class Weapon < ActiveRecord::Base | |
belongs_to :character | |
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
# trying to get "entity" to act as whatever you pass to method, so if you pass person @event.person would be returned. | |
# below is what I ended up using, just in case anyone else runs into this >.> | |
def get_scope(entity) | |
entity = entity.pluralize.downcase.to_sym | |
@event.send entity | |
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
ramiro@tedera:/var/www/ramiro.mx/current$ rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '1.9.3@ramiromx' -c 'cd /var/www/ramiro.mx/releases/20111201083621 && rake RAILS_ENV=production db:migrate --trace' | |
WARNING: Possible conflict with Rake extension: String#ext already exists | |
WARNING: Possible conflict with Rake extension: String#pathmap already exists | |
** Invoke db:migrate (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
rake aborted! | |
stack level too deep | |
/usr/local/rvm/gems/ruby-1.9.3-p0@ramiromx/gems/rake-0.9.2.2/lib/rake/task.rb:162 | |
Tasks: TOP => db:migrate => environment |
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
#! /bin/sh | |
# After copying this to /etc/init.d/nginx and setting chmod + x then run update-rc.d -f nginx defaults | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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
# Post Model | |
class Post < ActiveRecord::Base | |
belongs_to :user | |
validates :title, :presence => true | |
validates :content, :presence => true | |
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
@import "reset"; | |
@mixin rounded($radius: 5px) { | |
border-radius: $radius; | |
-moz-border-radius: $radius; | |
-webkit-border-radius: $radius; | |
} | |
@mixin shadow($dist: 5px, $str: 3px, $top: 0, $left: 0, $color: rgba(0,0,0,.1) ) { | |
box-shadow: $color $top $left $dist $str; |
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
<div id='location_selectors'> | |
<ul> | |
<li class="select optional geo_selector" id="activity_geo_location_input" style="display:none"><label for="activity_location_id">Geo location</label> | |
<select id="activity_location_id" name="activity[location_id]"> | |
<option value="1256">1256</option> | |
<option value="2664">2664</option> | |
<option value="3986">3986</option> | |
</select> | |
</li> | |
<li class="select optional map_selector_420" id="activity_area_input" style="display:none"> |