This file contains 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
Contact.joins(:addresses).includes(:addresses).where("first_name LIKE 'A%').each do |contact| | |
puts contact.address.inspect | |
end |
This file contains 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
Contact.joins(:addresses).includes(:addresses).where("first_name LIKE 'A%').each do |contact| | |
puts contact.address.inspect | |
end |
This file contains 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 'active_record' | |
require 'sqlite3' | |
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', | |
:database => 'db/address_book.db' | |
ActiveRecord::Base.connection.execute <<-SQL | |
-- Address book schema | |
CREATE TABLE contacts ( |
This file contains 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
begin | |
ActiveRecord::Schema.define do | |
create_table :listings do |table| | |
table.column :url, :string | |
table.column :title, :string | |
table.column :authors_email, :string | |
table.column :emailed_at, :datetime | |
table.column :created_at, :datetime | |
table.column :updated_at, :datetime | |
end |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<h1>Senderbots Craigslist Crawler</h1> | |
<h3><p>History</p></h3> | |
</head> | |
<body> | |
</body> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<h1>Senderbots Craigslist Crawler</h1> | |
<h3><p>Instructions: Go to Craigslist and create your search, in any category. Copy the URL and paste it below.</p></h3> | |
<script src= "/bootstrap/js/bootstrap.min.js"></script> | |
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.css"/> |
This file contains 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 'sinatra' | |
get '/' do | |
erb :index | |
end | |
get '/history' do | |
erb :history | |
end |
This file contains 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 everlane(string) | |
new_string = string.gsub(/[bcdefghij]/, "a").gsub(/[MKP]/, "Q") | |
test_array = [] | |
array = new_string.split(//) | |
status = "VALID" | |
array.length.times do | |
current_letter = array.pop | |
case current_letter | |
when "a" |
This file contains 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
var inWords = function(number){ | |
var numberHash = { | |
0:"", 1:"one", 2:"two", 3:"three", 4: "four", 5: "five", 6: "six", 7: "seven", 8: "eight", 9: "nine", 10: "ten", | |
11: "eleven", 12: "twelve", 13: "thirteen", 14: "fourteen", 15: "fifteen", 16: "sixteen", 17: "seventeen", 18: "eighteen", | |
19: "nineteen", 20: "twenty", 30: "thirty", 40: "forty", 50: "fifty", 60: "sixty", 70: "seventy", 80: "eighty", 90: "ninety" | |
}; | |
if(number <= 20){ | |
return numberHash[number]; | |
} |
This file contains 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
# module SudokuSolver | |
class Gameboard | |
attr_reader :board, :rows, :columns, :quadrants, :before_array, :after_array | |
def initialize(initial_values) | |
@board = [] | |
@rows = [] | |
@columns = [] | |
@quadrants = [] | |
generate_cells(initial_values) |
NewerOlder