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
const path = require('path'); | |
const GitHubApi = require('github'); | |
const jsonfile = require('jsonfile'); | |
const moment = require('moment'); | |
const async = require('async'); | |
const config = require('./config.json'); | |
const github = new GitHubApi({ protocol: 'https' }); | |
github.authenticate({ type: 'oauth', token: config.token }); |
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 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 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
public static class MappingExtensions | |
{ | |
public static void Unflatten<T>(this IMemberConfigurationExpression<T> config) | |
{ | |
config.ResolveUsing(resolutionResult => | |
{ | |
var context = resolutionResult.Context; | |
var prefix = context.MemberName; | |
var destProperties = context.DestinationType.GetProperties(); | |
var dest = Activator.CreateInstance(context.DestinationType); |
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
start /wait msiexec /i Octopus.Tentacle.<version>.msi /quiet INSTALLLOCATION=C:\Octopus | |
cd C:\Octopus\Agent | |
tentacle configure --appdir="C:\Applications" --port=10933 --trust=<server-thumbprint> | |
tentacle new-certificate | |
tentacle install | |
tentacle register-with --server=<server-url> --environment=<environment> --role=<role> --apikey=<some-user-apikey> | |
octo deploy-release --project=<project-name> --deployto=<environment-to-deploy> --version=<version-to-deploy> --server=<server-url> --apikey=<some-user-apikey> |
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('ngTranscludeAppend', function() { | |
return function(scope, element, attrs, ctrl, transcludeFn) { | |
if (!transcludeFn) return; | |
transcludeFn(function(clone) { | |
element.append(clone); | |
}); | |
}; | |
}); |
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 sumsOfDivisors = from i in Enumerable.Range(1, 10000) | |
select new { Number = (long)i, SumOfDivisors = Toolbox.GetProperDivisors(i).Sum() }; | |
var amicableNumbers = from a in sumsOfDivisors | |
join b in sumsOfDivisors on new { x = a.Number, y = a.SumOfDivisors } equals | |
new { x = b.SumOfDivisors, y = b.Number } | |
where a.Number != b.Number | |
select a.Number; |
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 la="ls -a" | |
alias psa="ps aux" |
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 getPermutations(set) { | |
var result = []; | |
permutate(set); | |
return result; | |
function permutate(set, subset) { | |
if (!subset) subset = []; | |
if (set && !set.length) { | |
result.push(subset); | |
return; |