// Cons: make code too redundant
var MyModel = Backbone.Model.extend({
initialize: function() {
this.updateDerivedAttributes();
this.on('change:start_at', this.updateDerivedAttributes, this);
},
updateDerivedAttributes: function() {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name socialbase content list replace url | |
| // @namespace http://use.i.E.your.homepage/ | |
| // @version 0.1.1 | |
| // @description enter something useful | |
| // @match http://socialbase.hk/socialbase/content/* | |
| // @copyright 2014+, bammoo | |
| // ==/UserScript== | |
| require(['jquery'], function($) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Using AMD/RequireJS | |
| * | |
| * The `auth` module handles OAuth and stores the | |
| * access token that needs to be sent in a header | |
| */ | |
| define(['api/auth'], function (auth) { | |
| 'use strict'; | |
| /* |
When visit Virtual Box site, the client ip is gateway of virtual machine, not your dev machine ip.
- Add
import pdb;pdb.set_trace()to any Django view, and open the view in chrome - Switch to termianl,
request.META.get('REMOTE_ADDR', None)at the break point - The result is the true client ip address
This gist is deprecated, please use display: table instead
NewerOlder