I hereby claim:
- I am rmulligan on github.
- I am ryanmulligan (https://keybase.io/ryanmulligan) on keybase.
- I have a public key ASAMK2TOkHU-5gwl22_lnIk1hau2AKIM3Hy7oXYjbWB5sgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
require "./student" | |
require "set" | |
counter = 0 | |
students = Set.new # Sets only have unique values, so you don't have to worry about duplicate students | |
File.open("passwd", "r") do |infile| # Change this file to /etc/passwd or wherever your file is | |
while (line = infile.gets) | |
if line.match(/\/home\/students/) # Ignore lines that aren't students | |
student_attrs = line.split(":") # Create array of attributes split on the colon |
def method_missing(name, *args) | |
if name =~ /^get_stores_by_/ | |
eigenclass = class << self; self; end # flatten scope | |
eigenclass.class_eval do | |
define_method(name) do |*args| | |
query = "#{@base_url}/store/#{name.to_s.camelize(:lower)}.json?" | |
args[0].collect do |key, value| | |
if value.is_a? Array | |
value.each {|v| query << "#{key.to_s.camelize(:lower)}=#{v.to_s}&"} | |
else |