This file contains 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 'octokit' | |
client = Octokit::Client.new login: 'username', password: 'password' | |
repos = [] | |
page = 1 | |
loop do | |
puts "Fetching repositories from page ##{page}" |
This file contains 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
# iPhone 6 Reservation Availability in Australia | |
# !! Please use responsibly. Personal use only !! | |
# `ruby iphone6.rb` - list all available models in all stores | |
# `ruby iphone6.rb R405` - list available models for a specific store, Rundle Place in this example. | |
require 'open-uri' | |
require 'json' | |
MODEL_NAMES = { | |
"MG4A2X/A" => "iPhone 6 Space Grey 128GB", |
This file contains 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
https://github.com/bbatsov/rubocop/blob/master/config/default.yml | |
rubocop -D --only Style/ClassAndModuleChildren -a | |
git cam "[rubocop] Fixing 'Style/FirstParameterIndentation' cop" |
This file contains 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
Fonte: http://gohorseprocess.wordpress.com | |
1- Pensou, não é XGH. | |
XGH não pensa, faz a primeira coisa que vem à mente. Não existe | |
segunda opção, a única opção é a mais rápida. | |
2- Existem 3 formas de se resolver um problema, a correta, a errada e | |
a XGH, que é igual à errada, só que mais rápida. |
This file contains 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
// http://code.jquery.com/jquery-latest.js | |
// Reference: https://gist.github.com/tedmiston/c7ac401da96b55022aaf | |
$("li._k- span.accessible_elem").each(function() { | |
$(this).parent().parent().parent().prev().children()[1].click(); | |
}); |
This file contains 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
<!-- Text Expander - MySQL snippets --> | |
<dict> | |
<key>abbreviation</key> | |
<string>;mysqld</string> | |
<key>label</key> | |
<string>MySQL dump</string> | |
<key>plainText</key> | |
<string>mysqldump %fillpart:name=remote host%-h server.com %fillpartend%-u %filltext:name=username:default=root% -p %filltext:name=database name:default=_development% > %filltext:name=file name:default=dump.sql%</string> | |
</dict> |
This file contains 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
$ rspec | |
Run options: include {:focus=>true} | |
All examples were filtered out; ignoring {:focus=>true} | |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
😄 hi. | |
👾 Hi human, what's your name? | |
. |
This file contains 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
Rails::Generator::Commands::Create.class_eval do | |
def template(relative_source, relative_destination, template_options = {}) | |
file(relative_source, relative_destination, template_options) do |file| | |
# Evaluate any assignments in a temporary, throwaway binding. | |
vars = template_options[:assigns] || {} | |
b = template_options[:binding] || binding | |
# this no longer works, eval throws "undefined local variable or method `vars'" | |
# vars.each { |k, v| eval "#{k} = vars[:#{k}] || vars['#{k}']", b } | |
vars.each { |k, v| b.local_variable_set(:"#{k}", v) } |
This file contains 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 'rdoc' | |
converter = RDoc::Markup::ToMarkdown.new | |
rdoc = File.read(ARGV[0] || 'README.rdoc') | |
puts converter.convert(rdoc) | |
# ruby rdoc2md.rb > README.md | |
# ruby rdoc2md.rb ABC.rdoc > abc.md |
This file contains 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
badge | year | color | fuel | price | title | description | image | kilometres | link | |
---|---|---|---|---|---|---|---|---|---|---|
Elite | 2010 | White | Diesel | 12990 | 2010 Hyundai ix35 | The 2010 Hyundai ix35 Elite Sports Automatic All Wheel Drive in White | http://liveimages.carsales.com.au/carsales/car/dealer/180316017.jpg?aspect=FitWithinNoPad&height=750&width=560 | 137891 | http://www.carsales.com.au/dealer/details/Hyundai-ix35-2010/AGC-AD-16650996/?Cr=0&sdmvc=1 | |
Elite | 2010 | Sleek Silver | Petrol - Unleaded ULP | 15900 | 2010 Hyundai ix35 | The 2010 Hyundai ix35 Elite Sports Automatic All Wheel Drive in Sleek Silver | http://liveimages.carsales.com.au/carsales/car/private/cp5660190667547643765.jpg?aspect=FitWithinNoPad&height=750&width=560 | 141500 | http://www.carsales.com.au/private/details/Hyundai-ix35-2010/SSE-AD-3033756/?Cr=1&sdmvc=1 | |
Active | 2011 | Black | Petrol - Unleaded ULP | 16350 | 2011 Hyundai ix35 | The 2011 Hyundai ix35 Active MY11 Sports Automatic in Black | http://liveimages.carsales.com.au/carsales/car/dealer/182253036.jpg?aspect=FitWithinNoPad&height=750&width=560 | 103540 | http://www.carsales. |