Skip to content

Instantly share code, notes, and snippets.

View ferventcoder's full-sized avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
@idavis
idavis / Regex.ps1
Created August 21, 2012 18:14
Ruby Style Regex Matching in Powershell
function =~ {
param([regex]$regex, [switch]$debug, [switch]$caseSensitive)
process {
$matches = $null
$mached = $false
if($caseSensitive) {
$matched = $_ -cmatch $regex
} else {
$matched = $_ -match $regex
}
@hlindberg
hlindberg / ticketmatch.rb
Created March 13, 2014 01:05
Script to match puppet tickets from git log with list from jira
# This script mangles the output from git log between two git references
# and matches this with a list of tickets from Jira.
#
# The List from Jira can be obtained by showing the list of issues for a release
# i.e. a query like this for the given release which gets all targeting the
# release in question:
#
# project = PUP AND fixVersion = "3.5.0" ORDER BY key ASC
#
# Then removing all columns from the output except key.
@lholman
lholman / Set-BuildNumber.ps1
Last active May 9, 2016 11:41
A psake task for managing assembly versioning in .NET applications
#*================================================================================================
#* Purpose: Sets the full build number ([major].[minor].[build].[revision]) in a consistent global way
#* for all builds. We purposefully only use TeamCity to generate the incrementing [build] number.
#* Set
#*================================================================================================
Task Set-BuildNumber {
$major = "1"
$minor = "0"
#Get buildCounter passed in from TeamCity, if not use zero
@nddrylliog
nddrylliog / winbrew.md
Last active December 20, 2015 16:19
Winbrew
@kylog
kylog / gist:5959294
Created July 9, 2013 17:21
This is part of .bash_kylo. The prompt stuff is WIP and there's some old code. The Darwin line is the most recently hacked on prompt. And note the sshk function which I use to carry the .bash_kylo file forward to move the prompt (and other stuff) to new hosts. All kinda hacky but works for now.
# Fun with prompts
# Ideas:
# http://www.maketecheasier.com/8-useful-and-interesting-bash-prompts/2009/09/04
# http://www.termsys.demon.co.uk/vtansi.htm
# http://slashdot.org/comments.pl?sid=108424&cid=9219400
#
RESET="\[\017\]"
NORMAL="\[\e[0m\]"
BRIRED="\[\e[1;31m\]"
@Iristyle
Iristyle / gist:1776477
Created February 9, 2012 02:03
CloudInit.NET script for Windows Core 2008 R2 with IIS, .NET 4 and WebDeploy 2.0
#! /powershell/
Set-StrictMode -Version Latest
$log = 'c:\cloudfu.txt'
Add-Content $log -value "Initial Execution Policy: [$(Get-ExecutionPolicy)]"
Set-ExecutionPolicy Unrestricted
Add-Content $log -value "New Execution Policy: [$(Get-ExecutionPolicy)]"
Add-Content $log -value "Path variable [${env:Path}]"
Add-Content $log -value "PSModulePath variable [${env:PSModulePath}]"
@erichexter
erichexter / gist:3717010
Created September 13, 2012 19:35
install chocolatey with windows auth proxy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted;$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$a.downloadstring('http://bit.ly/OKgXHP')|iex
@mseankelly
mseankelly / NuGet.target tweak
Created July 8, 2012 00:07
Subvert NuGet 2.0's insistence that the developer explicitly enable package restore.
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<!--Update the NuGet.target file that is generated when you enable NuGet package restore with the following tweak.-->
<!--This will make it so that everyone pulling the project from source control will automatically pull the requisite NuGet packages the first time they build.-->
<!--While I understand why MS put this in place, it really doesn't make sense in the context of my current team (or any other team I've ever worked on).-->
<SetEnvironmentVariable EnvKey="EnableNuGetPackageRestore" EnvValue="true" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
var inputs = new[] { "http://www.google.com", "http://www.yahoo.com", "http://www.aol.com", };
var results = await inputs.AsAsync()
.WhereAsync(async x => await IsPageInTop10WebSitesByTraffic(x))
.SelectAsync(async x => await DownloadPageAsync(x))
.GetResults();
@KevM
KevM / Nuget.Config
Created January 19, 2012 23:19
Nuget configuraiton of package sources.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<add key="myrepo" value="\\server\\share\\path" />
</packageSources>
</configuration>