This file contains hidden or 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 'jumpstart_auth' | |
class JSTwitter | |
attr_reader :client | |
def run | |
puts "Welcome to the JSL Twitter Client!" | |
command = "" | |
while command != "q" | |
printf "enter command: " |
This file contains hidden or 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
Home Buying Checklist | |
Property Address | |
Asking Price | |
Real Estate Taxes | |
The Neighborhood | |
Near Work | |
Near Schools | |
Near Shopping | |
Near Expressways | |
Near Public Transportation |
This file contains hidden or 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
(1..100).each do |each| | |
if each % 3 == 0 and each % 5 == 0 | |
puts "FizzBuzz" | |
elsif each % 3 == 0 | |
puts "Fizz" | |
elsif each % 5 == 0 | |
puts "Buzz" | |
else | |
puts each | |
end |
This file contains hidden or 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
def parse_file(filename) | |
@people = [] | |
@contents.each do |row| | |
person = {} | |
person[:id] = row[0] | |
person[:regdate] = row[:regdate] | |
person[:first_name] = clean_first_name(row[:first_name]) | |
person[:last_name] = clean_last_name(row[:last_name]) | |
person[:email] = clean_email(row[:email_address]) | |
person[:phone] = clean_phone(row[:homephone]) |
This file contains hidden or 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
#------------------BEFORE---------------------------- | |
def width #column width for 'queue print' | |
first_name_length = [12] | |
last_name_length = [12] | |
email_length = [] | |
city_length = [] | |
street_length = [] | |
@queue.each do |person| | |
first_name_length << person[:first_name].length | |
last_name_length << person[:last_name].length |
This file contains hidden or 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 'rubygems' | |
require 'sinatra' | |
require 'json' | |
require 'sequel' | |
require 'pg' | |
require 'haml' | |
require 'shotgun' | |
get '/' do | |
haml :index |
This file contains hidden or 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
def process_params(params) | |
@identifier = params[:identifier] | |
@rooturl = params[:rootUrl] | |
if missing_parameters?(params) | |
halt 400, "Bad Request! missing required parameters" | |
else | |
"#{{identifier: @identifier}.to_json}" | |
end | |
end |
This file contains hidden or 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
guard 'rspec', :cli => "--color --format nested --fail-fast --drb" do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch(%r{^(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
end |
This file contains hidden or 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
class Query | |
def initialize | |
@hash = {} | |
end | |
def method_missing(name, *args) | |
value = args.length > 0 ? args.first : true | |
@hash.merge!(name => value) | |
self | |
end |
This file contains hidden or 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
class Series | |
attr_reader :digits | |
def initialize(input) | |
@digits = input.split("").map{|i| i.to_i} | |
end | |
def slices(input) | |
slices = [] | |
digits.count.times do |i| | |
slices << digits[i...i+input] |
OlderNewer