- Download this application skeleton.
- Convert the app to use AJAX.
- Add any files you changed to your gist and submit your code.
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 Sudoku | |
#so effing close it's not even funny. | |
def initialize(board_string) | |
board_string_array = board_string.split('') |
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 Array | |
def my_map(&block) | |
self.each_index do |i| | |
yield (self[i] = block.call(self[i])) | |
end | |
end | |
end | |
a = [1,2,3,4] |
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 fibonacci_iterative(n) | |
fibonaccis = [0,1] | |
until fibonaccis.length > n | |
fibonaccis.push(fibonaccis[-1] + fibonaccis[-2]) | |
end | |
fibonaccis[n] | |
end | |
def fibonacci_recursive(n) | |
if n == 0 |
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 Sudoku | |
#RKelley is boss. | |
def initialize(board_string) | |
board_string_array = board_string.split('') | |
@board = Array.new(9){Array.new(9)} |
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
# Solution for Challenge: Scraping HN 1: Building Objects. Started 2013-09-04T16:13:44+00:00 | |
require 'nokogiri' | |
require 'open-uri' | |
class Post | |
attr_reader :title, :url, :points, :item_id | |
def initialize((post),title, url, points, item_id) | |
@comments = [] |
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 'net/http' | |
require 'nokogiri' | |
class Page | |
def initialize(url) | |
@links = doc.search(url)('.body> a:first_child').map{|link| link} |
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 'csv' | |
class Recipe | |
attr_reader :id, :name, :description, :ingredients, :directions | |
def initialize(id, name, description, ingredients, directions) | |
@id = id | |
@name = name | |
@description = description |
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 'sqlite3' | |
require_relative 'setup_revised' | |
class Contact | |
attr_accessor :first_name, :last_name, :company, :phone, :email | |
def initialize(hash) | |
@id = hash[:id] |
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
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
OlderNewer