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 heavy_decimal_count(a,b) | |
heavy = [] | |
(a..b).collect do |number| | |
chars = number.to_s.split('').collect{|x| x.to_i} | |
heavy << number if (get_avg(chars) > 7) | |
end | |
heavy | |
end | |
def get_avg(arr) |
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 bookmark! | |
uri = Addressable::URI.new | |
uri.query_values = cleanse(params) | |
uri.path = request.env["REQUEST_PATH"] | |
session[:last_bookmark] = uri.to_s | |
end | |
def bookmark | |
session[:last_bookmark] ||= root_path | |
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
accommodation_types: | |
view_all: View all | |
host-family: Host Family | |
student-residence: Student Residence | |
hotel: Hotel | |
apartment-or-studio: Apartment or Studio | |
bed-breakfast: "Bed & Breakfast" | |
campus-residence: Campus Residence |
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 locale_from_currency(currency) | |
case currency | |
when :GBP | |
:en | |
when :USD | |
:en | |
when :EUR | |
:de | |
end | |
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
resources :messages, :except => [:index] do | |
collection do | |
get :create_new, controller: 'messages/build', action: :create | |
end | |
resources :build, controller: 'messages/build' | |
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
#gbx3, .gbes, #gbz, .aeG>.ov, #gbi4t, .TC, #oneGoogleWrapper #gb, #gbar-header #gb { | |
display: none !important; | |
} | |
.AOaixb.yRwDId.eub5Ne { | |
top: 120px !important; | |
} | |
#docs-header.docs-og-minibar #docs-titlebar-container { | |
top: -50px; | |
} | |
#gbu, #gbq, #gbx1 { |
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
$ ~/ nslookup | |
> server 8.8.8.8 | |
Default server: 8.8.8.8 | |
Address: 8.8.8.8#53 | |
> o localhost | |
Server: 8.8.8.8 | |
Address: 8.8.8.8#53 | |
Non-authoritative answer: | |
Name: o.dev.kyanmedia.net |
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
LOG: could not bind IPv4 socket: Can't assign requested address | |
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. | |
WARNING: could not create listen socket for "localhost" | |
FATAL: could not create any TCP/IP sockets |
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 Array | |
def foo | |
puts self | |
end | |
end | |
class Bar < ActiveRecord::Base | |
...blah | |
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
Writing is hard, so do it. | |
========================== | |
Over the last few months I've been working on something that I wouldn't have seen myself doing at any point in my life, and that's the task of writing a book. I'm not talking about a 'Janet & John' novel, or some sort of 'Fifty Shades of Grey' sort of affair, but a proper printed dead tree, trip over it, technical book. | |
It all started back in May/June time when I was approached by a good friend at [Heroku](http://www.heroku.com), who had been approached in turn by [O'Reilly](http://www.oreilly.com), to produce a book about the platform and some rough ideas for what sort of book might be relevant and saleable. At the end of a fairly lengthy process it ended up that I was the author, had a contract in my hand and a schedule to try and stick to. | |
Cripes | |
## Getting started |