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 library = | |
function(container) { | |
var stringify = function(obj, rootName) { | |
/* implementation goes here */ | |
}; | |
container.stringify = stringify; | |
return container; | |
}; // define the library in a function, injecting external dependencies if needed | |
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 Execute-Each($list) { | |
$list |% { & $exe $_ } | |
} | |
function Edit-UsingSublimeText2($path) { | |
$exe = "C:\Program Files\Sublime Text 2\sublime_text.exe" | |
$files = @() | |
$files += $path | |
$files += $input | |
(Execute-Each $files) | |
} |
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 Git-Init($project, $username = 'your-username-here') { | |
md $project | |
cd $project | |
git init | |
ni -t f readme.md | |
git add . | |
git commit -m "first commit" | |
git remote add origin git@github.com:$username/$project.git | |
git push -u origin master | |
Write-Host "$project has been created and pushed to github." |
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 SharepointSearchForm = (function () { | |
var uniqueArray = function (arr) { | |
var uniqueValues = []; | |
$.each(arr, function (index, item) { | |
if ($.inArray(item, uniqueValues) === -1) { | |
uniqueValues.push(item); | |
} |
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($directoryToFlatten = '.', $scormSubDir = 'SCORM_support') | |
$supportDir = "$directoryToFlatten\$scormSubDir" | |
if((Test-Path $supportDir)) { | |
mi "$supportDir\*.*" $directoryToFlatten | |
ri $supportDir | |
Write-Host 'Support files moved...' | |
} |
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 CamlQueryBuilder = function() { | |
}; | |
CamlQueryBuilder.prototype.withExactValues = function(fieldValues) { | |
this.exactFieldValues = fieldValues; | |
this.doExactQuery = true; | |
}; | |
CamlQueryBuilder.prototype.thatContains = function(fields, values) { |
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 Find-File([string[]]$patterns, [string]$extension, [string] $joinPattern = "[\w|/|\\]*") { | |
$regex = $patterns -join $joinPattern | |
ls -r -i "*.$extension" | where { $_.Fullname -match $regex } |% { $_.Fullname } | |
} | |
Set-Alias -Name ff -Value Find-File | |
function Find-Solution([string[]]$patterns){ | |
Find-File -e sln $patterns | |
} |
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 Select-Head ([string]$text, [int]$index, [string]$pattern) { | |
$input += $text | |
return $input | where { $_ -is [string] } |% { | |
if($pattern) { | |
$index = $_.IndexOf($pattern) | |
} | |
if($index -ge $_.length) {return $_} | |
return $_.Substring(0, $index) | |
} | |
} |
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
using System; | |
using System.Threading; | |
namespace Testing | |
{ | |
public class AsyncSpecification | |
{ | |
private static readonly AutoResetEvent signal = new AutoResetEvent(false); | |
protected static void Wait(TimeSpan timeout) |
OlderNewer