Skip to content

Instantly share code, notes, and snippets.

using Akka.Actor;
using System.Collections.Generic;
namespace Actors
{
public class PreformanceCounterActor : ReceiveActor
{
private Dictionary<string, long> _counters;
public PreformanceCounterActor()
@jpierson
jpierson / ToMarkdownTable
Last active January 25, 2017 03:12
Linq style extension method for producing a table in markdown format from IEnumerable<T> source.
public static class LinqMarkdownTableExtensions
{
public static string ToMarkdownTable<T>(this IEnumerable<T> source)
{
var properties = typeof(T).GetProperties();
var maxColumnValues = source
.Select(x => properties.Select(p => p.GetValue(x)?.ToString()?.Length ?? 0))
.Union(new[] { properties.Select(p => p.Name.Length) }) // Include header in column sizes
.Aggregate(
@jpierson
jpierson / t-sql-tips.md
Last active February 28, 2017 18:49
T-SQL Tips

T-SQL Tips

Get definitions for all stored procedures and functions for a database

Getting the definitions can be useful when attempting to locate specific constants or dynamic usage of other database objects such as functions or tables.

select p.[name], s.[definition]
from sys.procedures p
 inner join sys.sql_modules s on p.[object_id] = s.[object_id]

Install Windows 10 VM free on Windows 7

If you find yourself forced to work in a Windows 7 environment but need or would like access to some Windows 10 features it turns out there is at least one way that I've stumbled accross which has worked for me.

Install a Virtual Machine

As far as free options that are well supported in Windows 7 Oracle Virtual Box seemed to be the best option I could find. If you go this route make sure to enable virtualization in the BIOS of your system to enable installing a 64-bit guest OS.

Install Windows 10 Pro as as a Guest OS

@jpierson
jpierson / one-time-git-setup.md
Created April 24, 2017 09:06
Setup instructions for Git
@jpierson
jpierson / gitflow-breakdown.md
Last active May 24, 2017 02:37 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@jpierson
jpierson / ElmScratchPad.md
Last active August 2, 2017 03:38
Experimentation with the Elm language

Elm experiments

Lists

Join a list of strings into a single string with specified separator

import Html exposing (text)

v = [1,2,3]
@jpierson
jpierson / advent-of-code-2017-elm-day1.elm
Last active December 8, 2017 05:19
Code solution for Advent of Code 2017 Day 1 (http://adventofcode.com/2017/day/1)
module Main exposing (main)
import Html exposing (Html, li, text, ul)
import Html.Attributes exposing (style)
-- Advent of Code 2017 - Day 1 (http://adventofcode.com/2017/day/1)
-- https://ellie-app.com/hBMTrVXyna1/1
main : Html msg
main =
@jpierson
jpierson / advent-of-code-2017-elm-day1-part2.elm
Created December 8, 2017 05:20
Code solution for Advent of Code 2017 Day 1 (http://adventofcode.com/2017/day/1)
module Main exposing (main)
import Html exposing (Html, li, text, ul)
import Html.Attributes exposing (style)
-- Advent of Code 2017 - Day 1 Part 2 (http://adventofcode.com/2017/day/1)
main : Html msg
main =
ul []