Skip to content

Instantly share code, notes, and snippets.

View danielmoore's full-sized avatar

Daniel Moore danielmoore

View GitHub Profile
@danielmoore
danielmoore / New-PieChart.ps1
Created May 28, 2011 22:58
Creates a new pie chart using WPK
param([string] $CountProperty = 'Count',
[string] $NameProperty = 'Name',
[double] $Width = 400,
[double] $Height = 300,
[string] $WindowTitle = 'Pie Graph',
[string] $ChartTitle = $null,
[Parameter(ValueFromPipeline = $true)] $Items,
[switch] $Show = $false)
begin {
Import-Module wpk
@jdiamond
jdiamond / mongoose-as-promised.js
Created December 30, 2012 18:58
Mongoose as Promised
var mongoose = require('mongoose');
var Q = require('q');
mongoose.Promise.prototype.then = function(fulfilled, rejected) {
var deferred = Q.defer();
this.addCallback(deferred.resolve);
this.addErrback(deferred.reject);
return deferred.promise.then(fulfilled, rejected);
function Invoke-Csx {
param($script = 'System.Console.WriteLine("Hello World");')
foreach($dll in (dir .\lib)) { Add-Type -Path $dll.FullName}
$engine = New-Object Roslyn.Scripting.CSharp.ScriptEngine $null, $null
$engine.AddReference("System")
$engine.AddReference("System.Core")
$session = $engine.CreateSession()