Skip to content

Instantly share code, notes, and snippets.

View hylander0's full-sized avatar

Justin Hyland hylander0

View GitHub Profile
@hylander0
hylander0 / git.removal_branches_except.cmd
Created November 21, 2019 20:33
Remove all your local git branches but keep...
$ git branch | grep -v "master" | xargs git branch -D
@hylander0
hylander0 / gist:d9510001fb977cba3e6d
Last active October 5, 2015 16:35
Parse & Convert CSV using Pure Linq
private static List<CustomClassOfColumns> ParseCsv(string csvData)
{
csvData = csvData.TrimEnd('\r', '\n'); //Remove last CRLF
var items = from line in csvData
.Split(new string[] { Environment.NewLine }, StringSplitOptions.None) //Split each row
.Skip(1) //Skip column names
let col = line.Split(',') //split each column
select new CustomClassOfColumns()
{
col1 = col[0],
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@hylander0
hylander0 / gist:8607290
Created January 24, 2014 21:47
This is a Private.xml file for KeyRemap4MacBook. This custom key remapping definition remapps Windows key combinations (Ctrl-C Ctrl-V, etc) on a Mac.
<?xml version="1.0"?>
<root>
<item>
<name>Use PC Style Undo</name>
<appendix>(Control+Z to Command_L+Z)</appendix>
<appendix>(Except in Vi, Terminal, VM, RDC, Emacs, X11)</appendix>
<identifier>remap.undo_winstyle_no_term_vi_firefox</identifier>
<not>VI, EMACS, TERMINAL, VIRTUALMACHINE, REMOTEDESKTOPCONNECTION, TEAMVIEWER, X11</not>
<autogen>--KeyToKey-- KeyCode::Z, VK_CONTROL, KeyCode::Z, ModifierFlag::COMMAND_L</autogen>
</item>