Skip to content

Instantly share code, notes, and snippets.

View krusty's full-sized avatar

Lucas Sallovitz krusty

View GitHub Profile
# 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'
{
"data": {
"count": 494,
"total_count": 494,
"posts": [
{ … },
{ … },
{ … },
{ … },
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);
},
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');
}
[extensions]
color =
pager =
hgext.mq =
[pager]
pager = LESS='FSRX' less
[diff]
git = true
@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;
apply_to_f(f, funcs) {
return function () {
var a = arguments;
return f(
_.map(funcs, function(h) {
return h(a);
});
)
}
}
@krusty
krusty / gist:2164463
Created March 22, 2012 20:58
blocking view
View: Backbone.View.extend({
initialize: function (options) {
if (typeof this.smb_initialize === "function") {
this.smb_initialize(options);
}
this.block_options = this.block_options || {};
this.block_options.element = this.block_options.element || this.$el;
this.block_options.object = this.block_options.object ||
this.object;
@krusty
krusty / fetch.js
Created March 28, 2012 23:02
Backbone setTimeout callbacks
fetch: function (options) {
this.trigger('fetching');
Backbone.Model.prototype.fetch.call(
this,
smb.wrap_callbacks(this, options)
);
},
diff --git a/src/smb/static/javascripts/modules/listing.js b/src/smb/static/javascripts/modules/listing.js
--- a/src/smb/static/javascripts/modules/listing.js
+++ b/src/smb/static/javascripts/modules/listing.js
@@ -124,17 +124,17 @@
},
idAttribute: 'inst_id',
url: function () {
return "/account/" +