Skip to content

Instantly share code, notes, and snippets.

@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 / switch-local-git-repo-to-fork.md
Last active December 26, 2022 21:48 — forked from jagregory/gist:710671
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

    git clone git@github...some-repo.git
@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]
@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(
using Akka.Actor;
using System.Collections.Generic;
namespace Actors
{
public class PreformanceCounterActor : ReceiveActor
{
private Dictionary<string, long> _counters;
public PreformanceCounterActor()