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
$tempDir = ([system.io.path]::GetTempPath()) | |
Import-Module pscx 2>$null | |
$Pscx:Preferences['TextEditor'] = 'C:\Program Files\Sublime Text 3\subl.exe' | |
set-alias edit Edit-File -Scope Global | |
Set-Alias vim 'C:\Program Files (x86)\vim\vim74\vim.exe' | |
Set-Alias vi vim | |
Import-Module z | |
#if(-not $env:OwPassword) { |
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
<# | |
.SYNOPSIS | |
Check out a range of Subversion revisions and recommit them to Mercurial | |
.DESCRIPTION | |
In the case where you already have an svn and an hg repository and you are transferring commits from one to the other (this is relevant when slowly transitioning svn to hg) you might get in a situation where several commits are made to the svn repository but not to the hg one. In this case you might want to check these out of svn one by one and re-commit to mercurial. This script automates the process. | |
This script requires an svn and an hg command to exist in your powershell environment. You can do this (assuming Tortoise) by adding 'C:\Program Files\TortoiseSVN\bin' and 'C:\Program Files\TortoiseHg' to your PATH or setting up the appropriate aliases. | |
.PARAMETER FromRevision | |
SVN revision to start checking out at. | |
.PARAMETER FromRevision | |
SVN revision to stop checking out at. |
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
syntax: glob | |
# Ignore Visual Studiofiles | |
*.obj | |
*.pdb | |
*.user | |
*.aps | |
*.pch | |
*.vspscc | |
*_i.c |
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
w = window | |
w.defr = (fnOrCtx, fnOrUndef) -> | |
ctx = if fnOrUndef then fnOrCtx else window | |
fn = if fnOrUndef then fnOrUndef else fnOrCtx | |
submittedArgs = null | |
getDeferredGenerator = (_.find(defr.conversions, (c)->c.canAdapt fn, ctx)?.adapt || defr.defaultConversion) | |
getDeferred = _.wrap getDeferredGenerator(fn, ctx), (fn, args...) -> | |
submittedArgs = _.toArray args | |
fn.apply @, args |
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(){ | |
//Initialize a jQuery Ui Widget on this element. | |
//<button id="click-here" data-bind="widget: {name: 'button' options: 'label:\'Click Here\', disabled: true'}, click: doSomething">Click Here</button> | |
//will have the same effect as | |
//<button id="click-here" data-bind="click: doSOmething">Click Here</button> | |
//<script>$(function(){ $('#click-here').button(label: 'Click Here'), disabled: true })</script> | |
//In the more common case when options are not needed you may simply write | |
//<button id="click-here" data-bind="widget: 'button', click: doSomething">Click Here</button> | |
ko.bindingHandlers.widget = { | |
init: function(el, valueAccessor){ |
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
// Elements with this binding will appear as a jquery ui dialog when the bound value exists | |
// This binding works similar to the 'with' data-binding in that its contents will only exist when its bound parameter is truthy. | |
// Also like with, it will start a new binding context. | |
// Unlike the 'with' binding, when the contents are visible this will not appear in place but instead be initialized in a | |
// jquery ui dialog. This dialog will close if the bounded value becomes falsy. Conversely, if the bound value is observable, | |
// closing the dialog will empty the observable. | |
var dialogDomDataKey = '__ko_dialogBindingData'; | |
ko.bindingHandlers.dialog = { | |
init: function(el, valueAccessor) { | |
var $el = $(el) |
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
SELECT TOP 10 ROW_NUMBER() OVER (order by id) FROM sysobjects |
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
//make a limited set of underscore functions transparently unwrap knockout observables | |
(function knockoutifyUnderscore(_) { | |
var unwrap = ko.utils.unwrapObservable; | |
//These can be shimed in a standard way | |
var koFriendly = ['map', 'filter', 'find', 'each', 'findBy', 'first', 'last', 'head', 'tail', 'union', 'compact', 'flatten', 'difference', 'without']; | |
var oldMap = _.map; | |
for (var _i = 0; _i < koFriendly.length; _i++) { | |
(function(fnName) { | |
var originalFn = _[fnName]; |
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
param( | |
[Parameter(Position=0,Mandatory=1)] [string]$name, | |
[Parameter(Position=1,Mandatory=1)] [string]$appVersion, | |
[Parameter(Position=2,Mandatory=1)] $script, | |
[string]$globalVersion = '1.0 - 01' | |
) | |
@" | |
--Will cause the transaction to abort if any errors are thrown for statements within it | |
SET XACT_ABORT ON | |
GO |
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 slice = Array.prototype.slice; | |
var _originalBridge = $.widget.bridge; | |
$.widget.bridge = function (name, object) { | |
var fullName = object.prototype.widgetFullName; | |
$.fn[name] = function (options) { | |
var isMethodCall = typeof options === "string", | |
args = slice.call(arguments, 1), | |
returnValue = this; |