Skip to content

Instantly share code, notes, and snippets.

View Solnse's full-sized avatar

Chad Solnse

View GitHub Profile
chad@zen:~/repos/cybercoders$ rvm current
ruby-2.0.0-p247
chad@zen:~/repos/cybercoders$ rvm info
ruby-2.0.0-p247:
system:
uname: "Linux zen 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux"
system: "ubuntu/13.10/x86_64"
bash: "/bin/bash => GNU bash, version 4.2.45(1)-release (x86_64-pc-linux-gnu)"
# missing_number_spec.rb
# Suppose you have an array of 99 numbers. The array contains the digits 1 to 100 with one digit missing.
# Write four different algorithms to compute the missing number.
# Two of these should optimize for low storage and two of these should optimize for fast processing.
require 'rspec'
def missing_number params
sum_total = 5050
@Solnse
Solnse / error
Last active August 29, 2015 13:58
rspec error
FF
Failures:
1) Creating Projects can create a project
Failure/Error: click_link 'New Project'
ActionController::ParameterMissing:
param not found: project
# ./app/controllers/projects_controller.rb:29:in `project_params'
# ./app/controllers/projects_controller.rb:6:in `new'
class Reward::Card
def initialize(params)
@type = params[:type]
@username = params[:username]
@password = params[:password]
end
def reward_balance
case @type
when "starbucks"
class Reward::Card
def initialize(params)
@type = params[:type]
@username = params[:username]
@password = params[:password]
@klass = Object.const_get(@type.capitalize)
end
def reward_balance
begin
require 'reward/starbucks'
require 'reward/united'
class Card
def initialize(params)
@type = params[:type]
@username = params[:username]
@password = params[:password]
begin
@klass = Object.const_get(@type.capitalize)
require 'reward/starbucks'
require 'reward/united'
class Reward
def initialize params
@type = params[:type]
@username = params[:username]
@password = params[:password]
@klass = Object.const_get(@type.capitalize) if Object.const_defined?(@type.capitalize)
end
params = {}
document.css('input').each do |input|
item = {}
item << { input.name => input.value }
params.push item
end
begin
balance = document.css('td.points').text
ytd_tqp = document.match('/TQPs<\/abbr><\/a>\s*<\/th>\s*<td>(\d+)<\/td>/')[0]
rescue => e
puts e.message
return {error: "ATTRIBUTES_CHANGED"}
end
chad@solnse-1:/etc/apache2$ cat apache2.conf
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to