Skip to content

Instantly share code, notes, and snippets.

View joshrowley's full-sized avatar

Josh Rowley joshrowley

  • GitHub Staff
  • Jersey City, NJ
View GitHub Profile
@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]
@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 / 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 / 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 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 / 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`
# Git status bash prompt
#
# In addition to printing the current working directory, this prompt will
# show a number of things if you are in a git repository:
# - The current branch you are in
# - Whether there are untracked files in the repository (there will be an
# asterisk after the branch nome if there are)
# - Whether there are any unmerged/unstaged/staged changes or if the directory
# is clean. See below for the colors that will be used, and change them if
# you'd like.
@joshrowley
joshrowley / pageview_by_browser.rb
Last active December 17, 2015 02:49
Parse Google Analytics Pageviews by Browser
require 'csv'
results = Hash.new 0
CSV.foreach('data.csv') { |row| results[row[1]] += 1 }
puts results

Encore

Give your Github issues a second life by reopening them when a resolving commit is merged into the staging branch of your project.

Models

Commit

  • sha
@joshrowley
joshrowley / mac_setup.md
Last active August 29, 2015 14:15
Mac Setup

Every once in a while I get a new computer and need to set it up the way I like it. I've tried automating this before, but I've found that the amount of time and effort I invest to automate is never worth the time it saves considering I hardly ever get a new computer. So instead, I keep a checklist of things to install and configure every time I get a new Mac:

Apps

  • Dropbox
  • 1Password
  • Alfred w/ Powerpack
  • Slack
  • Cloudup https://cloudup.com/dashboard
  • Divvy: set up Command + Shift + Space shortcut, and full, left, right, and o p shortcuts. Make a startup item.