This file contains hidden or 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
<%= @user.work_country_id.nil? ? "No Country" : @user.work_country.name %> |
This file contains hidden or 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
# The form which submits to profile#index | |
<div id="member_search"> | |
<%= form_tag profile_path, :method => :get do %> | |
<table style="width:100%"> | |
<tbody> | |
<tr> | |
<td style="text-align:right;padding-right:5px;">Name: </td> | |
<td><%= text_field_tag :s_name, params[:s_name] %></td> | |
</tr> | |
<tr> |
This file contains hidden or 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 tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
This file contains hidden or 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
javascript:(function() { | |
if(!window.your_bookmarklet) { | |
var doc = document, | |
js = doc.createElement('script'); | |
js.type = 'text/javascript'; | |
js.src = 'loader.js'; | |
js.async = true; |
This file contains hidden or 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
require "uri" | |
(URI::REGEXP.constants - ["PATTERN"]).each do |rc| | |
puts "#{rc}: #{URI::REGEXP.const_get(rc)}" | |
end | |
URI::REGEXP::PATTERN.constants.each do |pc| | |
puts "#{pc}: #{URI::REGEXP::PATTERN.const_get(pc)}" | |
end |
This file contains hidden or 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 ResumesController < ApplicationController | |
before_filter :authenticate_user! | |
respond_to :pdf | |
def index | |
end | |
def preview | |
# Error Correction Capacity (ECC) level | |
# L - 7% of codewords can be recovered |
This file contains hidden or 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
ree-1.8.7-2011.03 :001 > GolfBall.without_dimples | |
NameError: undefined local variable or method `dimples' for #<Class:0xc0c0290> |
This file contains hidden or 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 Application < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :job | |
# This model can also have validations to ensure applications are valid, whatever you want. | |
# Extra fields can also be added to this file, so it might get another field :rejected for example. | |
end |
This file contains hidden or 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
#Inside Photo model | |
has_attached_file :file, | |
:processors => [ :blurplates, :thumbnail ], | |
:styles => { :frontpage => "460x100000", :view => "740x100000", :medium => '300x300', :thumb => "100x100>" } | |
#blurplates.rb | |
# Load libs | |
require 'camellia' |
This file contains hidden or 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
Parameters: {"commit"=>"Create Post", "post"=>{"category"=>"asd", "title"=>"asd", "content"=>"asd", | |
"attachments_attributes"=>{"0"=>{"photo"=>#<ActionDispatch::Http::UploadedFile:0x1286485d8 @content_ | |
type="image/jpeg", @headers="Content-Disposition: form-data; name=\"post[attachments_attributes][0][p | |
hoto]\"; filename=\"DL_fb_WhereToBuy04.jpeg\"\r\nContent-Type: image/jpeg\r\n", @original_filename="D | |
L_fb_WhereToBuy04.jpeg", @tempfile=#<File:/var/folders/Kf/Kfc30tagH0mUfSKvAItau++++TM/-Tmp-/RackMulti | |
part20111104-18330-1dwd89-0>>}}}, "authenticity_token"=>"x24T9Td1tuZ78pYTcytwwX84+gcPVIrMhVmEp/BYGJ0= | |
", "utf8"=>"✓", "attachment_category"=>{"id"=>"2"}} |
OlderNewer