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
find . -maxdepth 1 -type d -mtime +14 -exec rm -r {} \; |
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
// Working model of how to use the Backbone.Paginator Plugin. | |
var defaults = { | |
queryParams: { | |
pageSize: '_limit', | |
currentPage: '_page', | |
totalPages: null, | |
totalRecords: null, | |
}, | |
state: { |
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
'.source.js': | |
'Form Input': | |
'prefix': 'input' | |
'body': ' | |
<div class="form-group">\n | |
<label class="col-md-3 control-label">$1</label>\n | |
<div class="col-md-6">\n | |
<input type="text" class="form-control col-xs-3" name="$2" value="{{model.$2}}" placeholder="" >\n | |
<span class="error help-block hide">Please enter a $1</span>\n | |
</div>\n |
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
Seems that parse.com has either neutered a portion of the their stripe.com integration, just decided it is not needed. The docs seem to point to the Stripe.Customers.update(id, token) as the way to add a card (using a token) to a customers account. This works, but only allows a single card. This overwrites the initial card with the new card. Not great. | |
// This should work, but only allows a single card. | |
Stripe.Customers.update(customer, { card: found.get('token') }, | |
function(err, token) { | |
console.log('got here for token'); | |
console.log(token); | |
}); | |
// This works, and seems to point to the need for parse.com to add some work to their backlog. Looks |
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
// GIT Merge | |
// Use this feature to push an local branch 'over' a remote branch. | |
// This is useful when mushing a local release branch into the staging | |
// environment. | |
git push origin localBranch:remoteBranch | |
or | |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 get_delicious_json( tags, settings) { | |
var url = 'http://feeds.delicious.com/v2/json/' + settings.username + '/'; | |
var tagStories = new Object(); | |
var target = $('<ul>', {}).appendTo(settings.target); | |
$.each(tags.split(settings.separator), function(index, tagStr) { | |
$.getJSON(url + tagStr + "?callback=?", function(data) { | |
$.each(data, function(key, val) { | |
t = val.u; |
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
// This is a custom validator that will ensure that | |
// the value is an array of two elements where each | |
// element matches the same regex format. | |
var _ = reqquire('underscore'); | |
var simpleDateRegex = new RegExp("^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])"); | |
Validator.prototype.arrayOf = function(size, regex) { | |
// Split the string into an array. |
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
/* | |
Used the url module to parse and place the parameters into req.urlparams. | |
Follows the same pattern used for swagger API path variables that load | |
into the req.params scope. | |
*/ | |
app.use(function(req, res, next) { | |
var url = require('url'); | |
var queryURL = url.parse(req.url, true); | |
req.urlparams = queryURL.query; |
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 Validator = require('validator').Validator; | |
Validator.prototype.isObjectID = function() { | |
var regex = new RegExp("^[0-9a-fA-F]{24}$"); | |
if (!regex.test(this.str)) { | |
this.error(this.msg + ', Requires a String of 12 bytes or a string of 24 hex characters.'); | |
} |
OlderNewer