Open file /etc/default/locale to add or change LC_ALL to the following
LC_ALL="en_US.UTF-8"
Then logout and login again.
Install necessary packages
| // includes bindings for fetching/fetched | |
| var PaginatedCollection = Backbone.Collection.extend({ | |
| initialize: function() { | |
| _.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by'); | |
| typeof(options) != 'undefined' || (options = {}); | |
| typeof(this.limit) != 'undefined' || (this.limit = 20); | |
| typeof(this.offset) != 'undefined' || (this.offset = 0); | |
| typeof(this.filter_options) != 'undefined' || (this.filter_options = {}); | |
| typeof(this.sort_field) != 'undefined' || (this.sort_field = ''); |
| namespace.views.MyWizard = Backbone.Views.extend({ | |
| initialize: function() { | |
| _.bindAll(this, 'render', 'wizardMethod'); | |
| } | |
| render: function() { | |
| this.wizardMethod(); | |
| return this; | |
| }, |
| This code is a suggested answer to question asked on Stackoverflow: | |
| http://stackoverflow.com/questions/4827965/can-i-change-djangos-auth-user-username-field-to-be-100-chars-long-without-break/ |
| var user = { | |
| validateCredentials: function (username, password) { | |
| return ( | |
| (!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
| : (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
| : (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
| : (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
| : (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
| : false | |
| ); |
| class App extends Spine.Controller | |
| @extend(Spine.Events) | |
| constructor: -> | |
| super | |
| # Initialize cache object | |
| App.cache = {} unless App.cache? |
| $ = jQuery | |
| $.fn.lineHeight or= -> | |
| if height = @data('lineHeight') | |
| return height | |
| # Create a hidden div with the same font | |
| # properties, then measure its height | |
| $shadow = $('<span />') | |
| $shadow.css({ |
| from flask.ext.sqlalchemy import SQLAlchemy | |
| def get_model(self, name): | |
| return self.Model._decl_class_registry.get(name, None) | |
| SQLAlchemy.get_model = get_model | |
| def get_model_by_tablename(self, tablename): | |
| for c in self.Model._decl_class_registry.values(): | |
| if hasattr(c, '__tablename__') and c.__tablename__ == tablename: | |
| return c |