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
queryStringToJson: function(querystring) { | |
var pairs = querystring.split('&'); | |
var result = {}; | |
pairs.forEach(function(pair) { | |
pair = pair.split('='); | |
result[pair[0]] = decodeURIComponent(pair[1].replace(/\+/g, '%20') || ''); | |
}); | |
return JSON.parse(JSON.stringify(result)); |
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
$.ajaxSetup({ | |
contentType: 'application/json', | |
dataType: "json", | |
contentType: 'application/json' | |
}); | |
$.ajaxPrefilter(function(options, originalOptions) { | |
if(options.type === 'post') { | |
options.data = JSON.stringify(originalOptions.data); | |
} |
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
$.validator.addMethod("cMinlength", function(value, element, param) { | |
var isValid = $.validator.methods.minlength.call(this, value, element, param.length); | |
$.validator.messages['cMinlength'] = param.message; | |
return isValid; | |
}); | |
$.validator | |
.addClassRules({ | |
'validate-name': { |
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
return restangular | |
.all('subscriptions') | |
.customDELETE('', {}, {}, payload); |
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
autoload -U zmv | |
zmv '(name)(*)' 'newName$2' |
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
/* | |
@Deps font awesome icons, lodash | |
@Usage | |
<table> | |
<thead sort-column="sortPersons"> | |
<tr> | |
<th sort-column-name="name">Name</tr> |
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
#!/bin/sh | |
# Redirect output to stderr. | |
exec 1>&2 | |
# enable user input | |
exec < /dev/tty | |
consoleregexp='console.log' | |
# CHECK | |
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0 | |
then |
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() { | |
'use strict'; | |
function mapPick(collection, keys) { | |
return _.map(collection, _.partialRight(_.pick, keys)); | |
} | |
_.mixin({ | |
'mapPick': mapPick | |
}); |
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
{ | |
"name": "pushUi", | |
"version": "0.0.0", | |
"devDependencies": { | |
"bower": "^1.6.5", | |
"browser-sync": "^2.10.1", | |
"del": "^2.2.0", | |
"gulp": "^3.9.0", | |
"gulp-angular-filesort": "^1.1.1", | |
"gulp-autoprefixer": "^3.1.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
alias npm-fresh-install="rm -rf node_modules && npm cache clean && npm install" |