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 get_model_name(item) | |
| item.class.to_s == Car.to_s ? item.content.class.to_s : item.class.to_s | |
| 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
| ## | |
| Lets say we have YoloFont.otf | |
| 1. We add it to vendor/assets/fonts/ folder | |
| 2. Me personaly creates a file named fonts.css.scss in app/assets/stylesheets | |
| In it I have | |
| @font-face{ | |
| font-family: 'YoloFont'; |
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
| describe 'ambitions spec' do | |
| it 'should return true only the first time #YOLO' do | |
| death.should be_true | |
| 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
| Give me some Clojure: | |
| > (empty? nil) | |
| true | |
| > nil | |
| nil | |
| > (nil? "") | |
| false | |
| > (empty? "") | |
| 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
| def create_report | |
| if @inspection.type == 'RoutineInspection' | |
| puts "---CR> CREATING ROUTINE INSPECTION REPORT" | |
| pdf = routine_inspection_generic | |
| else | |
| puts "---CR> CREATING INGOING INSPECTION REPORT" | |
| thread = Thread.new do | |
| pdf = ingoing_inspection_nsw | |
| end.join | |
| 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
| str = (0...MAX_NUM).map { |n| n.en.numwords }.join.gsub(/ and /, "").gsub(/\W/, "") | |
| NoMethodError: undefined method `en' for 0:Fixnum |
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
| <%= link_to '#' do %> | |
| hiii <%= image_tag('/images/menu-arrow-down.gif') %> | |
| <% 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
| source 'http://rubygems.org' | |
| # source 'http://localhost:9292' | |
| gemspec | |
| group :test do | |
| gem "simplecov", :require => false | |
| gem "shoulda-matchers" | |
| gem "shoulda-context" | |
| gem "capybara-screenshot" |
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 PerspectivesController < ApplicationController | |
| # GET /perspectives | |
| # GET /perspectives.json | |
| def index | |
| @perspectives = Perspective.all | |
| unless params['perspective'] | |
| @perspective = @perspectives.where(default: true).first || Perspective.new | |
| else | |
| @perspective = Perspective.new | |
| 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
| 2.0.0dev :015 > raw_params = {"layout"=>"layout_04", "zone_ids"=>["", "", "", "50e5a81a421aa977fa00000b"]} | |
| => {"layout"=>"layout_04", "zone_ids"=>["", "", "", "50e5a81a421aa977fa00000b"]} | |
| 2.0.0dev :016 > params = ActionController::Parameters.new(raw_params) => {"layout"=>"layout_04", "zone_ids"=>["", "", "", "50e5a81a421aa977fa00000b"]} | |
| 2.0.0dev :017 > params.permit(:zone_ids => []) => {"zone_ids"=>["", "", "", "50e5a81a421aa977fa00000b"]} |