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
// 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
_.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
[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
(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
[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
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
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 static class TypeExtensions | |
{ | |
/// <summary> | |
/// Determine whether a type is simple (String, Decimal, DateTime, etc) | |
/// or complex (i.e. custom class with public properties and methods). | |
/// </summary> | |
/// <see cref="http://stackoverflow.com/questions/2442534/how-to-test-if-type-is-primitive"/> | |
public static bool IsSimpleType( | |
this Type type) | |
{ |
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
CREATE PROC InsertGenerator | |
(@tableName varchar(100)) as | |
--Declare a cursor to retrieve column specific information | |
--for the specified table | |
DECLARE cursCol CURSOR FAST_FORWARD FOR | |
SELECT column_name,data_type FROM information_schema.columns | |
WHERE table_name = @tableName |