This file contains 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
cordova run android --device && adb logcat *:S CordovaLog:V CordovaWebView:V |
This file contains 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
Backbone.PageableCollection.extend({ | |
mode: 'server', | |
state: { | |
pageSize: 15, | |
firstPage: 0 | |
}, | |
queryParams: { | |
pageSize: 'limit', | |
currentPage: null, | |
totalPages: null, |
This file contains 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 ItemModel = Backbone.Model.extend({ | |
// emit fetch:error, fetch:success, fetch:complete, and fetch:start events | |
fetch: function(options) { | |
var _this = this; | |
options = options || {}; | |
var error = options.error; | |
var success = options.success; |
This file contains 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 eventThrottler(callback) { | |
if (!callback) { | |
return callback; | |
} | |
// @see http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
var requestAnimFrame = (function() { | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || |
This file contains 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
angular.module('myModule') | |
.directive('ngPhone', function() { | |
return { | |
require: 'ngModel', | |
link: function(scope, elem, attr, ngModel) { | |
function isPhone(str) { | |
var lengths = [7,10,11]; |
This file contains 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
while test $# -gt 0; do | |
case "$1" in | |
-h|--help) | |
echo "$package - attempt to capture frames" | |
echo " " | |
echo "$package [options] application [arguments]" | |
echo " " | |
echo "options:" | |
echo "-h, --help show brief help" | |
echo "-a, --action=ACTION specify an action to use" |
This file contains 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 extend() { | |
var a = arguments, target = a[0] || {}, i = 1, l = a.length, deep = false, options; | |
if (typeof target === 'boolean') { | |
deep = target; | |
target = a[1] || {}; | |
i = 2; | |
} | |
if (typeof target !== 'object' && !isFunction(target)) target = {}; |
This file contains 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 copyText (text) { | |
var div = document.getElementById('__special_copy_div'), | |
saveSelection, | |
selection, | |
rng, | |
i; | |
if (!div) { | |
div = document.createElement('pre'); | |
div.id = '__special_copy_div'; |
This file contains 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
server { | |
# ... | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 6; | |
gzip_buffers 16 8k; | |
gzip_http_version 1.1; |
This file contains 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 bob(val) { | |
if (this === window) { | |
return (new bob(val)).factorInc(); | |
} | |
else { | |
this.v = val; | |
} | |
} | |
bob.prototype.inc = function(v) { |
OlderNewer