Skip to content

Instantly share code, notes, and snippets.

View robzolkos's full-sized avatar

Rob Zolkos robzolkos

View GitHub Profile
@robzolkos
robzolkos / server.js
Created September 18, 2013 13:50
node/express listening on a socket. Not changing permissions on line 4.
fs.unlink("/tmp/app.sock", function(err) {
app.listen("/tmp/app.sock");
return setTimeout(function() {
return fs.chmod("/tmp/app.sock", 0x777, function(callback) {});
}, 2000);
});
@robzolkos
robzolkos / setup.txt
Last active December 18, 2015 03:48
Setting up an Ubuntu server
# install os
# setup ssh keys
# add build tools
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev
# NginX
sudo add-apt-repository ppa:nginx/stable
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
http://backbonejs.org/
http://marionettejs.com/
https://github.com/documentcloud/backbone/wiki/Tutorials,-blog-posts-and-example-sites
http://backbonefu.com/2011/11/modifying-your-urls-on-the-fly-using-the-request-method-with-sync-in-backbone-js/
http://addyosmani.github.com/backbone-fundamentals/#marionette
http://addyosmani.github.com/backbone-fundamentals/#memory-management
https://github.com/jsoverson/todomvc/tree/master/labs/architecture-examples/backbone_marionette
http://davidsulc.com/blog/2012/04/15/a-simple-backbone-marionette-tutorial/
http://davidsulc.com/blog/2012/04/22/a-simple-backbone-marionette-tutorial-part-2/
http://davidsulc.github.com/backbone.marionette-collection-example/
@robzolkos
robzolkos / ghost_backbone.txt
Created August 19, 2012 09:45 — forked from dougo-chris/ghost_backbone.txt
How to create ghost pages with backbone templates
Why
---
My site is backbone.js and rails, including the static marketing content. I wanted this content to be readable by google and I don't want two copies.
Background
----------
I'm using the haml_assets gem so I can write backbone.js views in haml.
Routes
------
@robzolkos
robzolkos / nginx.conf
Created July 29, 2012 06:50
nginx rewrute
location /system {
rewrite /system/ http://cr.s3.amazonaws.com/system/$1 permanent;
}
@robzolkos
robzolkos / gist:3163049
Created July 23, 2012 10:45 — forked from dougo-chris/gist:1992666
remote file uploads
TEMPLATE
----
%form#uploadAsset{"accept-charset" => "UTF-8", :action => "/admin/assets", "data-remote" => "true", :enctype => "multipart/form-data", :method => "post"}
%div{:style => "margin:0;padding:0;display:inline"}
%input{:name => "utf8", :type => "hidden", :value => "✓"}/
%input{:name => "authenticity_token", :type => "hidden", :value => ""}/
.element
.avatar.thin
%label.hint#assetLabel
Your Asset
@robzolkos
robzolkos / extension.js.coffee
Created July 23, 2012 10:45 — forked from dougo-chris/extension.js.coffee
Nested model in backbone.js
do ->
_parse = Backbone.Model.prototype.parse
_.extend Backbone.Model.prototype,
initNestedCollections: (nestedCollections) ->
@_nestedCollections = {}
_.each nestedCollections, (theClass, key) =>
@_nestedCollections[key] = new theClass([])
@resetNestedCollections()
@robzolkos
robzolkos / deploy.rb
Created June 25, 2012 07:03
deploy.rb for Linode
#$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require 'bundler/capistrano'
require 'rvm/capistrano'
require "capistrano_colors"
require 'thinking_sphinx/deploy/capistrano'
require 'delayed/recipes'
set :normalize_asset_timestamps, false
set :rvm_type, :user
set :rvm_ruby_string, 'ruby-1.9.3-p125@appname'
@robzolkos
robzolkos / gist:2970521
Created June 22, 2012 05:33
Heroku/S3 application creation notes
gem install bundler --pre
create a "appname-staging" bucket on S3
create a "appname-production" bucket on S3
rails new appname -d postgresql
rvm ruby-1.9.3-p194-perf@appname --create
add ruby "1.9.3" to Gemfile (2nd line)