Skip to content

Instantly share code, notes, and snippets.

View mdepolli's full-sized avatar

Marcelo De Polli mdepolli

  • Shore GmbH
  • Munich, Germany
View GitHub Profile
Verifying my Blockstack ID is secured with the address 1FaMJoHHkn1WiHDjdAwf83myWrwHY3661d https://explorer.blockstack.org/address/1FaMJoHHkn1WiHDjdAwf83myWrwHY3661d
@mdepolli
mdepolli / beatles.rb
Created November 30, 2017 00:19
Ruby para iniciantes - 29/nov/2017
john = "John Lennon"
ringo = "Ringo Starr"
paul = "Paul McCartney"
george = "George Harrison"
beatles = [john, ringo, paul, george]
sorted_beatles = beatles.sort
puts sorted_beatles
@mdepolli
mdepolli / ocr.markdown
Last active August 29, 2015 14:26 — forked from henrik/ocr.markdown
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@mdepolli
mdepolli / margarita.md
Last active August 29, 2015 14:25 — forked from moklett/margarita.md
The Perfect Margarita

The Perfect Margarita

This is my "go to" margarita because of the ease of preparation and the simplicity of ingredients.

TL;DR

1oz orange liqueur, 2oz tequila, 3oz limeade, 1/2 lime, shaken with ice.

Keybase proof

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:

@mdepolli
mdepolli / foo.rb
Last active December 14, 2015 08:29
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')
### 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%,...,...)
@mdepolli
mdepolli / Default (Mac).sublime-keymap
Last active October 12, 2015 22:38
Sublime Text 2 user settings
[
{ "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"
}
@mdepolli
mdepolli / Gemfile
Created September 13, 2012 16:17
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
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