Skip to content

Instantly share code, notes, and snippets.

View gertig's full-sized avatar

Andrew Gertig gertig

View GitHub Profile
@gertig
gertig / hack.sh
Created March 31, 2012 12:05 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@gertig
gertig / 0_instructions.txt
Created March 30, 2012 14:42 — forked from stan/0_instructions.txt
Sprocket 2 in Rails 3.0.x ala Rails 3.1
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
filesystem will be different but this guide will get you working with it
while we wait for all that to finalize.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention
- (void)viewDidLoad {
self.currentPage = 0;
self.dataSource = [[NSMutableArray alloc] init];
}
- (void)fetchData {
[[SVHTTPClient sharedClient] GET:@"https://api.github.com/users/AndrewGertig/watched"
parameters:[NSDictionary dictionaryWithValue:[NSNumber numberWithInt:self.currentPage] forKey:@"page"]
completion:^(id response, NSError *error) {
[self.dataSource addObjectsFromArray:response];
@gertig
gertig / api.rb
Created January 6, 2012 03:31 — forked from lucatironi/api.rb
Snippets for an API with grape
# Server App
# This file must be in lib/myapp/api.rb
module MyApp
module Entities
class Products < Grape::Entity
expose :id, :code, :name, :short_description
expose :description, :unless => { :collection => true }
expose (:category) { |model, options| model.category.name }
expose (:brand) { |model, options| model.brand.name }
end
@gertig
gertig / hn_scraper.rb
Created November 12, 2011 15:38
grab top stories from hacker news (supports pagination)
require 'rubygems'
require 'nokogiri'
require 'open-uri'
def is_numeric_or_short(str)
return str.length <= 5
end
url = "http://news.ycombinator.com"
doc = Nokogiri::HTML(open(url))
@gertig
gertig / peepcode.rb
Created August 18, 2011 20:40 — forked from jmazzi/peepcode.rb
A script to download all Peepcode screencasts with ruby & wget (supports resume)
require 'mechanize'
@username = 'user@domain.com'
@password = 'hi2u'
@download_path = File.expand_path 'downloads'
@wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt'
unless File.directory? @download_path
puts "@{download_path} doesn't exist!"
exit
@gertig
gertig / gist:988056
Created May 24, 2011 02:40 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this screencast if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent then a phone call or screen sharing.
www:
requirements:
- faye
- jade
Host heroku.com
HostName heroku.com
User git
IdentityFile ~/.ssh/heroku.identity
IdentitiesOnly yes
require 'rake/clean'
HAML = FileList['**/*.haml']
LESS = FileList['**/*.less']
COFFEE = FileList['**/*.coffee']
HTML = HAML.ext('html')
CSS = LESS.ext('css')
JS = COFFEE.ext('js')