Skip to content

Instantly share code, notes, and snippets.

Ellin Tolstov fenelon

Block or report user

Report or block fenelon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View secret_santa.rb
class SecretSanta
attr_reader :pairs
def initialize(filename)
@data = File.read(filename)
@list = @data.split("\r\n").map{|s| s.split("\t")}
end
def pick
@pairs = []
@fenelon
fenelon / gist:7459572c5b0dc344a0cb5591bfc9b540
Last active Apr 19, 2016
Transfer pansions to global matcher
View gist:7459572c5b0dc344a0cb5591bfc9b540
gm = Matcher.new(0)
Operator.pluck(:id).each do |o|
pansions = Matcher.new(o).list(:pansions).to_a.map{|e| [e[0].mb_chars.downcase, e[1]]}.to_h
pansions.each_pair do |k,v|
if gm.get(:pansion, k)
puts 'skip '+k
else
puts 'new '+k
gm.set(:pansion, k, v)
end
@fenelon
fenelon / faye.rb
Created Dec 7, 2012 — forked from betamatt/faye.rb
Faye launcher for Monit
View faye.rb
#!/usr/env ruby
base_dir = File.expand_path("../..", __FILE__)
NAME="faye"
PID="#{base_dir}/tmp/pids/#{NAME}.pid"
COMMAND="bundle exec rackup /home/deployer/apps/leveltravel/shared/config/faye.ru -s thin -E production"
case ARGV[0]
when "start"
You can’t perform that action at this time.