This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 setBitOn(number, bit) { | |
| return number | 1 << bit; | |
| } | |
| function setBitOff(number, bit) { | |
| return number & ~(1 << bit); | |
| } | |
| function toggleBit(number, bit) { | |
| return number ^ 1 << bit; |
This file contains hidden or 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 Permutations | |
| { | |
| public static IEnumerable<IEnumerable<T>> Get<T>(IEnumerable<T> set, IEnumerable<T> subset = null) | |
| { | |
| if (subset == null) subset = new T[] { }; | |
| if (!set.Any()) yield return subset; | |
| for (var i = 0; i < set.Count(); i++) | |
| { | |
| var newSubset = set.Take(i).Concat(set.Skip(i + 1)); |