Skip to content

Instantly share code, notes, and snippets.

View siegy22's full-sized avatar
:shipit:

Yves Siegrist siegy22

:shipit:
View GitHub Profile
@siegy22
siegy22 / install_redis.rb
Last active August 26, 2016 07:04
Install redis from ruby code
def which(cmd)
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
exe = File.join(path, "#{cmd}#{ext}")
return exe if File.executable?(exe) && !File.directory?(exe)
end
end
nil
end

EAir16 Bot

A little ruby bot to win Energy Air 2016 Tickets.

Dependencies

  • ruby (preffered 2.2.2)
  • poltergeist
  • capybara
require 'nintendo'
class Pingu < Nintendo::Character
def roll
move(:shield, :stick_left)
end
def attack
move(:stick_down, :attack)
end
1: git log -S auto_explain_threshold_in_seconds --reverse
2: git log -1 0306f82e0c3cda3aad1b45eb0c3a359c254b62cc --format=fuller
3: git tag --contains 0306f82e0c3cda3aad1b45eb0c3a359c254b62cc -l | grep 'v' | head -n 1
4: git tag --contains d3688e0 -l | grep 'v' | head -n 1
5: activerecord/lib/active_record/explain.rb
6: git log --pretty=format:%an --follow activerecord/lib/active_record/explain.rb | sort | uniq
7: 'We discussed that the auto explain feature is rarely used.
This PR removes only the automatic explain. You can still display
the explain output for any given relation using `ActiveRecord::Relation#explain`.
class MyAwesomeRake
class Task
attr_reader :dependencies, :description, :block
def initialize(description, dependencies = [], &block)
@dependencies = dependencies
@description = description
@block = block