Skip to content

Instantly share code, notes, and snippets.

View thisivan's full-sized avatar

Ivan Torres thisivan

View GitHub Profile
@thisivan
thisivan / paginated_collection.js
Created October 17, 2011 11:50 — forked from io41/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@thisivan
thisivan / rmagick.sh
Created September 7, 2011 18:37 — forked from zoras/rmagick.sh
Install RMagick on Ubuntu 11.04
sudo apt-get install libdjvulibre-dev libjpeg-dev libtiff-dev libwmf-dev libmagickcore-dev libmagickwand-dev libmagick++-dev rvm
sudo gem install rmagick
ok!
Fetching: rmagick-2.13.1.gem (100%) Building native extensions. This could take a while ... Successfully installed rmagick-2.13.1 1 gem installed
require 'RMagick' #=> true
# Rebase
$ git commit -a -m "Commit message"
$ git fetch
$ git rebase [branch] # origin/master
$ git push
# Stash
$ git stash
$ git pull
$ git stash apply
@thisivan
thisivan / homebrew-install.rb
Created October 28, 2009 12:37
HomeBrew Installation Script
#!/usr/bin/env ruby
require 'fileutils'
def fail!(msg = "Failure!")
puts(msg)
exit(1)
end
REPOSITORY_URL = 'git://github.com/mexpolk/homebrew.git'
PACKAGE_URL = 'http://github.com/mexpolk/homebrew/tarball/master'
# Rebase
$ git commit -a -m "Commit message"
$ git fetch
$ git rebase [branch] # origin/master
$ git push
# Stash
$ git stash
$ git pull
$ git stash apply