Skip to content

Instantly share code, notes, and snippets.

Chris Hunt cdhunt

Block or report user

Report or block cdhunt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View PivotData.ps1
Add-Type -Path C:\Users\chris.hunt\Downloads\PivotData\lib\NReco.PivotData.dll
$CSV = gc "C:\Users\chris.hunt\Downloads\PivotData\NReco.PivotData.Examples.CsvDemo\TechCrunchcontinentalUSA.csv" | ConvertFrom-Csv
$aggregators=new-object Collections.ArrayList
$aggregators.Add([NReco.PivotData.SumAggregatorFactory]::new('raisedAmt')) | Out-Null
$aggregators.Add([NReco.PivotData.AverageAggregatorFactory]::new('raisedAmt')) | Out-Null
$aggregators.Add([NReco.PivotData.MaxAggregatorFactory]::new('raisedAmt')) | Out-Null
View Select-FuzzyCommand.ps1
function Select-FuzzyCommand {
param(
$search=''
)
Begin {
$data = Get-Command
$search = $search.ToCharArray() -join '.*?'
View pesterexample.ps1
Function Get-Parmeters {
[CmdletBinding()]
Param(
[string]$ComputerName,
[scriptblock]$ScriptBlock
)
$parameters = @{}
$Session = New-PSSession -ComputerName 'server'
@cdhunt
cdhunt / Help to MD
Created May 26, 2016
Use the Markdown.types.ps1xml to generate a help file in Markdown
View Help to MD
$help = Get-Help Get-Location
$help.Name.MarkdownHeader()
"Synopsis".MarkdownHeader(2)
$help.Synopsis
"Description".MarkdownHeader(2)
@cdhunt
cdhunt / Markdown.types.ps1xml
Last active May 26, 2016
A custom type file to help generate markdown
View Markdown.types.ps1xml
<?xml version="1.0" encoding="utf-8" ?>
<Types>
<Type>
<Name>System.String</Name>
<Members>
<ScriptMethod>
<Name>MarkdownStrong</Name>
<Script>
[OutputType([System.String])]
param()
@cdhunt
cdhunt / output
Created Mar 1, 2016
Beating Hadoop with Posh
View output
Black White Tie RunTime
----- ----- --- -------
2853633 3762820 3260741 6 minutes, 45 seconds, 347 milliseconds
@cdhunt
cdhunt / Verbal Expressions
Created Jan 5, 2016
Messing around with CSharpVerbalExpressions and Fluent API in Powershell
View Verbal Expressions
Add-Type -Path C:\Temp\CSharpVerbalExpressions-master\VerbalExpressions\bin\Release\VerbalExpressions.dll
[psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::add("verbex", "CSharpVerbalExpressions.VerbalExpressions")
[verbex]::new().StartOfLine().Then("http").Maybe("s").Then("://").Maybe("www.").AnythingBut(" ").EndOfLine().Test("https://www.google.com")
$proto = [verbex]::new().StartOfLine().Then("http").Maybe("s").Then("://")
$Uri = $proto.AnythingBut(" ").EndOfLine()
$uri
$uri.Test("http://google.com")
View kanban.md

I agree with you, but prefer to decouple philosophy from tools. It's just semantics, but in the history of business organization there is a tendency to distill a philosophy down to a few bullet points and believe following those bullet points is all that is needed to be successful. One of the bullet points is usually, "Use XYZ tool." Just putting up a board with cards on it isn't likely going to make your business more successful. It's just a tool. You have to learn how to use it. Sorry if you took my weakness with words as an attack on your efforts to do just that.

View tvdbapiconsumer
# https://bitbucket.org/gfkeogh/simpledb/wiki/Home
Add-Type -Path C:\Scripts\Modules\SimpleDb\SimpleDb.Esent.dll
# Data Model
$episodeClass = @"
using System;
public class Episode
{
public string Series { get; set; }
public int Id { get; set; }
@cdhunt
cdhunt / Mount Outlook Drive
Last active Nov 1, 2015
Browse your email from PowerShell like a folder
View Mount Outlook Drive
Import-Module Simplex
New-PSDrive mail -psprovider simplex -root "C:\Temp\outlookprov.ps1"
cd mail:\Inbox
You can’t perform that action at this time.