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
| var store = new Ext.data.JsonStore({root: "data", url: "<url>", totalProperty: 'totalCount', idProperty: 'id',method: 'POST', fields:[]}); | |
| var page = new Ext.PagingToolbar({pageSize: 25, store: store}); | |
| var grid = new Ext.grid.GridPanel({store: store, tbar: page}); | |
| store.load({params:{start:0, limit:25}}); | |
| grid.render('#exapmle'); | |
| grid.on('filterupdate', function(){ | |
| var o = {}, pn = this.store.paramNames; | |
| o[pn.start] = 0; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Firebase & Knockout Test</title> | |
| <link rel="stylesheet" type="text/css" | |
| href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> | |
| <script src="https://cdn.firebase.com/v0/firebase.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.1.0/knockout-min.js"></script> | |
| <script type="text/javascript" | |
| src="https://code.jquery.com/jquery-1.11.1.min.js"></script> |
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
| ko.subscribable.fn.subscribeChanged = function (callback, target) { | |
| var oldValue; | |
| this.subscribe(function (_oldValue) { | |
| oldValue = _oldValue; | |
| }, target, 'beforeChange'); | |
| this.subscribe(function (newValue) { | |
| callback(newValue, oldValue, this); | |
| }, target); | |
| }; |
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
| var mainApp = angular.module('myApp', []); | |
| mainApp.service('ConfigService', function (){ | |
| var _environments = { | |
| local: { | |
| host: ['l', 'localhost'], | |
| config: { | |
| api_endpoint: '/api/v1', | |
| node_url: 'http://localhost:9998' | |
| } |
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
| var myApp = angular.module('myApp', []); | |
| // settings | |
| myApp.constant('settings', { | |
| apiEndpoint: '/api/v1', | |
| node: 'http://domain.com:8888', | |
| }); | |
| // controller | |
| myApp.controller('MyCtrl', ['$scope', 'settings', function($scope, settings){ |
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
| function Permissions(){ | |
| var self = this; | |
| /* Permissions */ | |
| self.permissions = ko.observableArray([]); | |
| /* | |
| * Set Permission | |
| * @param{String} key | |
| * @param{boolean} value |
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
| _.mixin({ | |
| koMatches: function (attrs) { | |
| return function (obj) { | |
| if (obj == null){ | |
| return _.isEmpty(attrs); | |
| } | |
| if (obj === attrs){ | |
| return true; | |
| } | |
| for (var key in attrs) { |
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
| function fish_prompt --description 'Write out the prompt' | |
| if not set -q __fish_prompt_hostname | |
| set -g __fish_prompt_hostname (hostname|cut -d . -f 1) | |
| end | |
| if not set -q __fish_prompt_normal | |
| set -g __fish_prompt_normal (set_color normal) | |
| end | |
| if not set -q __git_cb |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Auto Complete Test</title> | |
| <link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
| <script type="text/javascript"> | |
| var app = angular.module('mainApp', []); | |
| // Factory |