I hereby claim:
- I am mdepolli on github.
- I am depa (https://keybase.io/depa) on keybase.
- I have a public key ASDvqdn_0jxO4Hh6AM6EZQysE32YizCU2GdSMAngYck4Xwo
To claim this, I am signing this object:
### Default script | |
$if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/,)$if($gt(%totaldiscs%,1),%discnumber%-,)$if($ne(%albumartist%,),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title% | |
### My script | |
$rreplace($replace($if2(%albumartist%,%artist%),...,...),\\.\$,$noop(.))/$if($if2(%originaldate%,%date%),[$left($if2(%originaldate%,%date%),4)] ,)$rreplace($replace(%album%,...,...),\\.\$,$noop(.))$if($gt(%totaldiscs%,1),\, CD $num(%discnumber%,1),)$if($gt($left(%date%,4),$left($if2(%originaldate%,%date%),4)), [Released %date%],)/$num(%tracknumber%,2) - $replace(%title%,...,...) |
Verifying my Blockstack ID is secured with the address 1FaMJoHHkn1WiHDjdAwf83myWrwHY3661d https://explorer.blockstack.org/address/1FaMJoHHkn1WiHDjdAwf83myWrwHY3661d |
john = "John Lennon" | |
ringo = "Ringo Starr" | |
paul = "Paul McCartney" | |
george = "George Harrison" | |
beatles = [john, ringo, paul, george] | |
sorted_beatles = beatles.sort | |
puts sorted_beatles |
I hereby claim:
To claim this, I am signing this object:
b = {"foo" => 100, "bar" => 300, "zaz" => 5} | |
c = {"foo" => 200, "bar" => 8} | |
a = [b, c] | |
# ??? = {"foo" => 300, "bar" => 308, "zaz" = 5} | |
# Solução caffo 1 | |
response = Hash.new(0) | |
a.each {|i| i.each {|key, val| response[key] += val} } |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
[ | |
{ "keys": ["super+shift+v"], "command": "paste" }, | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+\\"], "command": "reveal_in_side_bar"}, | |
{ "keys": ["super+shift+c"], | |
"command": "sublime_highlight", | |
"args": { | |
"target": "clipboard", | |
"output_type": "rtf" | |
} |
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |
def br_titleize(word) | |
humanize(underscore(word)).gsub(/(?!(?<= )(de|da|do|das|dos|d'|e|a|o)\b)(\b[a-z\u00E0-\u00FC])/) { |s| s.mb_chars.capitalize.to_s } | |
end |
def flash_message | |
types = { :notice => 'info', :success => 'success', :error => 'error', :alert => 'error' } | |
flash.inject("") do |sum, message| | |
content_tag :div, :class => "alert alert-#{types[message[0]]}" do | |
button_tag('×'.html_safe, :type => 'button', :class => 'close', :'data-dismiss' => 'alert', :name => nil) + | |
message[1] | |
end | |
end | |
end |