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 mergesort(array) { | |
return sort(array, 0, array.length - 1); | |
function sort(array, start, end) { | |
if (start === end) return [array[start]]; | |
var middle = Math.floor((start + end) / 2); | |
return merge(sort(array, start, middle), sort(array, middle + 1, end)); | |
} |
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
document.addEventListener('DOMNodeInserted', function(event) { console.log('Inserted:', event.srcElement); }); | |
document.addEventListener('DOMNodeRemoved', function(event) { console.log('Removed:', event.srcElement); }); |
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
#!/bin/bash | |
set -e | |
if [ "$1" == "" ]; then | |
echo "fatal: pull request number must be provided" | |
exit 1 | |
fi | |
branch="pr/$1" |
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
#!/bin/bash | |
set -e | |
if [ "$1" != "" ]; then | |
release_name="release/$1" | |
else | |
release_name=$(git branch -r | tail -n1 | sed 's/.*origin\///') | |
fi | |
echo $release_name |
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
#!/bin/bash | |
set -e | |
release_branch=$(git-get-release-branch.sh $1) | |
local_branch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD) | |
if [ "$local_branch" != "master" ]; then | |
echo "The current branch is not master. Aborting." | |
exit 1 | |
fi |
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
#!/bin/bash | |
set -e | |
if [ "$1" != "" ]; then | |
release_name="release/$1" | |
else | |
release_name=$(git branch -r | tail -n1 | sed 's/.*origin\///') | |
fi | |
echo "Checking out branch '$release_name'..." |
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 Build-Arguments($project) { | |
$args = @() | |
$args += "create-release" | |
$args += "--server=%octopus.url%" | |
$args += "--apikey=%octopus.apikey%" | |
$args += "--project=$project" | |
$args += "--version=%octopus.releaseNumber%" | |
$args += "--deployto=%octopus.deployTo%" | |
$args += "--packageversion=%octopus.packageVersion%" | |
$args += "--force" |
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 Is-Default-Branch { | |
return "%teamcity.build.branch.is_default%" -eq "true" | |
} | |
function Set-TeamCity-Parameter($name, $value) { | |
Write-Host "##teamcity[setParameter name='$name' value='$value']" | |
} | |
if (Is-Default-Branch) { | |
$releaseNumber = "%octopus.master.releaseNumber%" |
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 Is-Default-Branch { | |
return "%teamcity.build.branch.is_default%" -eq "true" | |
} | |
function Build-Arguments { | |
if (Is-Default-Branch) { | |
$releaseNumber = "%octopus.master.releaseNumber%" | |
$deployTo = "%octopus.master.deployTo%" | |
$packageVersion = "%octopus.master.packageVersion%" | |
} |
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
app.directive('forceDatabinding', function() { | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, ngModel) { | |
ngModel.$parsers.push(function(value) { | |
return value || ngModel.$viewValue; | |
}); | |
} | |
}; | |
}); |