Skip to content

Instantly share code, notes, and snippets.

View krusty's full-sized avatar

Lucas Sallovitz krusty

View GitHub Profile
@krusty
krusty / default
Created March 20, 2012 15:25
Nginx proxy for assembla api
upstream assembla {
server www.assembla.com;
}
server {
listen *:8000;
server_name localhost;
rewrite_log on;
root /home/lucas/proyects/assembla.js;
[extensions]
color =
pager =
hgext.mq =
[pager]
pager = LESS='FSRX' less
[diff]
git = true
fetch: function (options) {
this.trigger('fetching');
var new_options = _.clone(options) || {};
var that = this;
new_options.success = function (arguments) {
if (options && typeof options.success === "function") {
options.success.call(arguments);
}
that.trigger('done');
}
fetch: function (options) {
this.trigger('fetching');
var new_options = _.clone(options);
new_options.success = function (arguments) {
options.success.call(arguments);
this.trigger('done');
}
Backbone.Model.prototype.fetch.call(this, new_options);
},
{
"data": {
"count": 494,
"total_count": 494,
"posts": [
{ … },
{ … },
{ … },
{ … },
# copy this file to local_settings.py and modify as necessary
DATABASE_SCHEMA = 'fbsec'
DATABASE_PASSWORD = ''
DATABASE_LOGIN = 'root'
DATABASE_SERVER = 'localhost'
# fetched from user_data in production
#DATABASE_SERVER = "reppler-prod.csjmdegnz98g.us-east-1.rds.amazonaws.com"
TYPE= 'ALL'
span.stars {
float: left;
height: 0;
width: 100px;
overflow: hidden;
padding: 20px 0 0 0;
background: url("/static/images/rating_stars.png") no-repeat;
background-color: green;
border: 1px solid white;
}
@krusty
krusty / gist:1978331
Created March 5, 2012 13:36
chat about events
[09:37:44] <krusty_ar> so, where do you mostly hook up your events? right now in my project they end up in the views initialize methods, but I'm thinking of puting it outside any backbone class (I'm not using routes yet), is there any other pattern?
[09:38:17] <-- Cromulent ([email protected]) has quit (Remote host closed the connection)
[09:38:32] <krusty_ar> it seems even if events do a nice decoupling, putting the .on call in one of the classes seems like introducing a dependency
[09:39:45] <-- shesek ([email protected]) has quit (Ping timeout: 248 seconds)
[09:40:40] <efdee> why would you not put them in your views initialize methods?
[09:40:47] <efdee> (assuming that your handlers are methods of your view)
[09:41:13] --> shesek ([email protected]) has joined #documentcloud
[09:41:22] <efdee> yes, your view depends on your model (or event bus). but there's nothing wrong with that.
[09:41:30] <krusty_ar> efdee: ma
*Gist.vim* Vimscript for creating gists (http://gist.github.com)
Usage |gist-vim-usage|
Tips |gist-vim-tips|
Requirements |gist-vim-requirements|
License |gist-vim-license|
Install |gist-vim-install|
This is a vimscript for creating gists (http://gist.github.com)
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,