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
Show hidden characters
/* Put it in: "%appdata%\Sublime Text 2\Packages\User" */ | |
{ "cmd": ["grunt.cmd"] } |
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
public class AbnIsActiveAttribute : ValidationAttribute | |
{ | |
private static string AbnValidationUrl = "http://abr.business.gov.au/abrxmlsearch/AbrXmlSearch.asmx/ABRSearchByABN?searchString={0}&includeHistoricalDetails=N&authenticationGuid=74fd05cb-bbf6-4525-a68f-c553f6349222"; | |
private static string ShouldContainString = "<entityStatusCode>Active</entityStatusCode>"; | |
public AbnIsActiveAttribute() | |
{ | |
ErrorMessage = "This ABN is inactive or invalid."; | |
} |
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
[alias] | |
tagcommit = !sh -c 'git rev-parse --verify $0~0' |
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 ($) { | |
$.showError = function(element, errorMessage, showInSummary, summaryLinkTargetElement) { | |
var $element = $(element); | |
var $form = $element.parents('form').first(); | |
var elementName = $element.attr('name'); | |
var elementLabel = $('label[for={0}]>span:first'.format(elementName)).text(); | |
var $validationSummary; | |
var $validationLink; | |
var $target = !summaryLinkTargetElement ? $element : $(summaryLinkTargetElement); | |
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
[user] | |
name = Jonathan Conway | |
email = jonathan.conway@gmail.com | |
[alias] | |
bn = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD` | |
br = branch | |
c = commit | |
co = checkout | |
com = checkout master | |
cp = cherry-pick $0 |
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
_.mixin({ | |
extendPick: function (objectA, objectB) { | |
return _.extend(objectA, _.pick(objectB, _.keys(objectA))); | |
} | |
}); |
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
// dependencies: requirejs, express | |
define(['express'], function (express) { | |
return function (app, resolver) { | |
return function(req, res, next) { | |
var oldRender = res.render; | |
res.render = function (view, model) { | |
return oldRender.call(this, resolver.call(this, req, res) + view, model); | |
}; | |
next(); |
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
exports.jquerygocontrib = function () { | |
var $ = require('jquerygo'); | |
$.evaluate = function (functionToEvaluate, callback, args) { | |
$.getPage(function (page) { | |
page.evaluate(functionToEvaluate, callback, args); | |
}); | |
}; | |
$.getlength = function (selector, callback) { |
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
// Reload (or initialize) addThis social share buttons. | |
// IMPORTANT: make sure you put in a correct pubid on line 7. | |
window.addthis_reload = function () { | |
if (!window.addthis) { | |
// Load addThis, if it hasn't already been loaded. | |
window['addthis_config'] = { 'data_track_addressbar' : false }; | |
$('body').append('<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={YOUR PUBID HERE}"></script>'); | |
} else { | |
// Already loaded? Then re-attach it to the newly rendered set of social icons. | |
// And reset share url/title, so they don't carry-over from the previous page. |
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
NDM Javascript Code Test Solutions | |
================================== | |
1. Fix the below Javascript code so that the correct index is printed to console.log on each iteration. | |
Solution: | |
(function() { | |
var index, | |
length = 10; |