Skip to content

Instantly share code, notes, and snippets.

# Need to Run As Admin
# Set locations
$WinSATFile = "MyWinSATScore.xml"
$WinSATFolder = "$ENV:windir\performance\winsat\datastore"
# Change to Location
push-location $WinSATFolder
# If WinSATFile exists Delete it.
If (Test-Path $WinSATFile)
@chriseyre2000
chriseyre2000 / gist:8683087b4f57d0fa72c5
Created December 22, 2014 12:18
Redis using StackExchange.Redis and Json.net
// Packages:
//<?xml version="1.0" encoding="utf-8"?>
//<packages>
// <package id="Newtonsoft.Json" version="6.0.3" targetFramework="net45" />
// <package id="StackExchange.Redis" version="1.0.371" targetFramework="net45" />
//</packages>
using System;
using System.Collections.Generic;
using System.Linq;
@chriseyre2000
chriseyre2000 / gist:ff0e3ddaf3959ba74bc4
Created November 30, 2014 18:20
Twitter api sample which allows count of non-retweets within a min.
using System.Linq;
//install-package TweetinviAPI
using Tweetinvi;
using Tweetinvi.Core.Enum;
namespace ClassLibrary1
{
public class Class1
{
@chriseyre2000
chriseyre2000 / check-code.ps1
Created October 11, 2014 17:29
Example of code analysis using StudioShell.Provider
### check-code.ps1 ###
# Run this in the Package Manager Console first - a solution must be open.
#Install-Package StudioShell.Provider
#The following should be run in the Package Manager Console in the form . \path\to\file\check-code.ps1 | out-gridview
#This is a great way of finding code entities where the filename does not match the elements name.
dir dte:/solution/codemodel -recurse | where Kind -Match 'vs.*(Class|Enum|Interface)' |select PSPath, Fullname, Name, Kind | % {
@chriseyre2000
chriseyre2000 / a
Created May 20, 2014 19:42
regex parser
Select-String 'shard number (?<num>\d{1,3})' outputlog.txt | %{$_.matches[0].Groups['num'].value} | sort -Unique | measure
@chriseyre2000
chriseyre2000 / profiler
Created May 13, 2014 21:09
Stackoverflow profiler demo : Install-Package MiniProfiler
using StackExchange.Profiling;
using System;
using System.Threading;
namespace ProfilerTest
{
public class Class1
{
static void Main()
{
@chriseyre2000
chriseyre2000 / loghelpher.ps1
Created March 5, 2014 21:46
Query WADLogs Helper
$pk = "0" + [DateTime]::UtcNow.AddHours(-1).Ticks
"PartitionKey gt '$pk' and Level lt 4" #This is the last hours warnings and errors
<html>
<head>
<meta charset="utf-8" />
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
</body>
</html>
@chriseyre2000
chriseyre2000 / _.md
Created March 4, 2014 22:15
Tributary inlet
@chriseyre2000
chriseyre2000 / Support Rota
Created February 28, 2014 13:59
Support Rota Calculator
$day = [DateTime]::Today.AddDays(1)
1..50 | % { $day.AddDays(7 * $_)}