Serviced Apartements / Condos in Nha Trang, Vietnam
- Little Home
- Cozy Condos
- Arabella Apartments
- Boutique Apartments
- Jennies Apartments
- Five Continents House
Classifieds
Serviced Apartements / Condos in Nha Trang, Vietnam
Classifieds
| # this gets called every time a user is authenticated | |
| # either via an actual sign in or through a cookie | |
| Warden::Manager.after_authentication do |user,auth,opts| | |
| auth.params.has_key?('user') ? 'trigger direct sign in' : 'trigger cookie sign in' | |
| end | |
| # this gets called every time a user is fetched from session. | |
| # happens on every request! | |
| Warden::Manager.after_fetch do |user,auth,opts| | |
| 'trigger user request' |
| class Invitation < ActiveRecord::Base | |
| belongs_to :invitable, primary_key: :email, foreign_key: :invitable_id, class_name: 'User' | |
| end | |
| class User < ActiveRecord::Base | |
| has_many :invitations, :primary_key, :email, foreign_key: :invitable_id | |
| end | |
| user = User.create(email: '[email protected]') | |
| invitation = Invitation.create(invitable: user) |
| Due to changes in my travel plans, I have to sell my ticket for Rubyconf Australia. | |
| I got my ticket in the first batch at the early-bird price. | |
| If you wanna buy the ticket get in touch with me: [email protected] | |
| Price: 495 AUD |
| require 'rubygems' | |
| require 'faster_csv' | |
| require 'net/http' | |
| require 'open-uri' | |
| class String | |
| require 'iconv' #this line is not needed in rails ! | |
| def to_utf8 | |
| Iconv.conv('utf-8','ISO-8859-1', self) | |
| end |
| Day job: Web-Engineering (Ruby on Rails, Freelancer) | |
| Favorite Python project: Django | |
| Favorite Conference: euruko | |
| Python Experience Level: few test-drives |
| module ApplicationHelper | |
| def with_format(format, &block) | |
| old_formats = formats | |
| lookup_context.send(:_set_detail, :formats, [format]) | |
| result = capture(&block) | |
| lookup_context.send(:_set_detail, :formats, old_formats) | |
| return result | |
| end | |
| end |
| ~/ ruby-1.9.2@fashmob_poc $ brew doctor | |
| You can install Homebrew anywhere you want, but some brews may only work | |
| correctly if you install to /usr/local. |
| def is_a_power_of_two?(n) | |
| return false if n.is_a?(Float) | |
| (n-1)& n == 0 if n != 0 | |
| end | |
| def logb2(n) | |
| if is_a_power_of_two?(n) | |
| return n.to_s(2).match(/1(0*)/)[1].length | |
| else | |
| false |