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
# Show active Git branch # | |
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' | |
} | |
# Example of prompt, full reference -> http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html # | |
export PS1="\u@\h:\w\$(git_branch)$ " |
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
irb(main):020:0> require 'benchmark' | |
=> false | |
irb(main):021:0> | |
irb(main):022:0* params = {'platform' => 'ios'} | |
=> {"platform"=>"ios"} | |
irb(main):023:0> | |
irb(main):024:0* Benchmark.bm do |x| | |
irb(main):025:1* x.report { platform = params['platform'].is_a?(Array) ? params['platform'].first : params['platform']; puts platform } | |
irb(main):026:1> x.report { platform = Array === params['platform'] ? params['platform'].first : params['platform']; puts platform } | |
irb(main):027:1> x.report { platform = Array(params['platform']).first; puts platform } |
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
before 'deploy', 'deploy:good_luck' | |
before 'deploy:migration', 'deploy:good_luck' | |
task :good_luck, roles: :app, except: { no_release: true } do | |
if Time.now.wday == 5 | |
logger.debug('') | |
logger.debug('┓┏┓┏┓┃') | |
logger.debug('┛┗┛┗┛┃\○/') | |
logger.debug('┓┏┓┏┓┃ / Friday') | |
logger.debug('┛┗┛┗┛┃ノ)') |
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
Toronto List | |
============ | |
Clothes | |
------- | |
* Vestido rayas naranja/rosa/granate | |
* Vestido gris bolsillos | |
* Vestido negro corazones | |
* Vestido negro lino |
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
GeoArch - Required Features 1.0 | |
------------ | |
* Users can create an account, and login into the application to obtain some extra features | |
* Users can add new info about an interesting architechtural points (name, description, photos, location) | |
* Users can view info added by themselves or by other users | |
* Users can edit (change, delete) info added by themselves | |
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
valakirka@miskatonic:~$ rake gems:install | |
gem install <gem> --source http://gems.github.com | |
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and | |
/usr/bin aren't both writable. | |
WARNING: You don't have ~/.gem/ruby/1.8/bin in your PATH, | |
gem executables will not run. | |
Successfully installed <gem> | |
1 gem installed |
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
<% form_for :ipoint, :html => { :multipart => true }, :url => { :action => "create" } do |f| %> | |
<%= f.error_messages %> | |
<p> | |
<%= f.label :name %><br /> | |
<%= f.text_field :name %> | |
</p> | |
<p> | |
<%= f.label :description %><br /> |
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
def create | |
@ipoint = current_user.ipoints.build(params[:ipoint]) | |
if @ipoint.save | |
flash[:notice] = 'Ipoint was successfully created.' | |
redirect_to(@ipoint) | |
else | |
flash[:notice] = 'There was an issue while saving the Ipoint' | |
render :action => "new" | |
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
class AddPhotoColumnsToIpoints < ActiveRecord::Migration | |
def self.up | |
add_column :ipoints, :photo_file_name, :string | |
add_column :ipoints, :photo_content_type, :string | |
add_column :ipoints, :photo_file_size, :integer | |
add_column :ipoints, :photo_updated_at, :datetime | |
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 Ipoint < ActiveRecord::Base | |
belongs_to :user | |
has_attached_file :photo | |
validates_attachment_presence :photo | |
end |
OlderNewer