Official tutorials
Nokogiri usage with css selection
Accessing node element attributes
extending string class
I used this line instead,
Dir[File.join(File.dirname(__FILE__), "core_ext", "*.rb")].each {|l| require l }
It worked till I decided to execute the file from another dir, seems that Dir[].each gives the files relative to the FILE but require expects the files relative to the cwd. Thus I replaced it with
Dir[File.join(File.dirname(__FILE__), "core_ext", "*.rb")].each {|l| require File.expand_path(l) }
expand_path captures the fullpath for us, that way require won't get confused
A to_boolean extension
For the method to work on the string (ie: like to_i) here's the new version
def to_boolean
self == 'true'
end
Match string with benchmarking
Capture specific regex
Check file ends with extname
Using open-uri:
IO.stream_copy method
Is there a magic trick for checksumming remote files?
String to date/time
date/time to string
Advanced: classes intro
Interesting stuff about scopes, and this one too
Scope resolution operator, more explanation(http://stackoverflow.com/questions/11043450/vs-dot-vs-double-colon-for-calling-a-method#comment48694104_11043499), and even more explanation
double colon
class methods vs instance methods class variable considerations
Unzip file
Check valid zip file
rubyzip: (the official gem)
zip:(useful for any ruby version even if <1.9.2) - inactive development last release was 2010
different ways for callbacks in ruby
Create directory if not found. Create nested directories
Logging notes
Interesting article about being verbose
Redis set/get elements
Redis subscribe to a channel , and even simpler
TTL, checking expiry
Redis with Rails
Single line conditioning, and even more conditioning
Loop with index