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
ul | |
{ | |
list-style: none; | |
padding: 0; | |
margin: 0; | |
} |
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
/* | |
|--------------------------------------------------------------------- | |
| 1. Szybkie zaznaczanie | |
|--------------------------------------------------------------------- | |
| Ctrl + D - zaznaczanie kolejnych elementow | |
| ALt + F3 - zaznaczenie wszystkich elementow | |
| PPm + Shift - zaznaczanie kolumnami | |
|--------------------------------------------------------------------- | |
| 2. Wyszukiwanie polecen i plikow | |
|--------------------------------------------------------------------- |
A timeline of the last four years of detecting good old window.localStorage
.
October 2009: 5059daa
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
h = { | |
'a' => :a_value, | |
'b' => nil, | |
'c' => false | |
} | |
h.fetch('a', :default_value) #=> :a_value | |
h.fetch('b', :default_value) #=> nil | |
h.fetch('c', :default_value) #=> false | |
h.fetch('d', :default_value) #=> :default_value |
Method lookup is a simple affair in most languages without multiple inheritance. You start from the receiver and move up the ancestors chain until you locate the method. Because Ruby allows you to mix in modules and extend singleton classes at runtime, this is an entirely different affair.
I will not build contrived code to exemplify the more complicated aspects of Ruby method lookup, as this will only serve to confuse the matter.
When you pass a message to an object, here is how Ruby finds what method to call:
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
error_page 400 404 405 =200 @40*_json; | |
location @40*_json { | |
default_type application/json; | |
return 200 '{"code":"1", "message": "Not Found"}'; | |
} | |
error_page 500 502 503 504 =200 @50*_json; | |
location @50*_json { |
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
<<APP>> change this variables |
- Initially install your pry-rails to group development on your apps Gemfile
group :development do
# ..
gem 'pry-rails'
# ..
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
require "bigdecimal" | |
# List of our individual pricing rules | |
TAX = ->(val) { val + val*0.05 } | |
FEE = ->(val) { val + 1 } | |
PREMIUM = ->(val) { val + 10 } | |
DISCOUNT = ->(val) { val * 0.90 } | |
ROUND_TO_CENT = ->(val) { val.round(2) } | |
# One presenter | |
PRESENT = ->(val) { val.to_f } |
OlderNewer