Skip to content

Instantly share code, notes, and snippets.

View joshrowley's full-sized avatar

Josh Rowley joshrowley

  • GitHub
  • Jersey City, NJ
View GitHub Profile
@joshrowley
joshrowley / deploy.rb
Created October 26, 2012 15:11
spike's deploy.rb
require "bundler/capistrano"
set :application, "studentbody"
set :repository, "https://github.com/xfernandox/studentbody.git"
set :user, 'josh'
set :deploy_to, "/home/#{ user }/#{ application }"
set :use_sudo, false
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
@joshrowley
joshrowley / oo_jukebox.rb
Created October 19, 2012 02:22
Object Oriented Jukebox
class Song
attr_accessor :name
@@song_library = []
def self.all
@@song_library
end
def initialize(name)
@joshrowley
joshrowley / jukebox.rb
Created October 18, 2012 00:07
Jukebox
songs = [
"The Phoenix - 1901",
"Tokyo Police Club - Wait Up",
"Sufjan Stevens - Too Much",
"The Naked and the Famous - Young Blood",
"(Far From) Home - Tiga",
"The Cults - Abducted",
"The Phoenix - Consolation Prizes"
]
@joshrowley
joshrowley / oo_jukebox.rb
Created October 17, 2012 23:53
Object Oriented Jukebox (with Session class)
class Song
attr_accessor :name
@@song_library = []
def self.all
@@song_library
end
def initialize(name)
@joshrowley
joshrowley / oo_jukebox.rb
Created October 17, 2012 22:05
Object Oriented Jukebox
class Song
attr_accessor :name
@@song_library = []
def add_to_library
@@song_library << self
end
def self.all
@joshrowley
joshrowley / scarper.rb
Created October 11, 2012 17:23
Flatiron Students Scraper
require 'open-uri'
require 'nokogiri'
require 'sqlite3'
doc = Nokogiri::HTML(open("http://students.flatironschool.com/davidbaker.html"))
name = doc.css('h1').text
name = name.split(" ")
first_name = name[0]