Skip to content

Instantly share code, notes, and snippets.

View JamieHouston's full-sized avatar

Jamie Houston JamieHouston

View GitHub Profile
# ssh into container
docker exec -t -i mycontainer-id /bin/bash
@JamieHouston
JamieHouston / fish snippets
Last active January 29, 2018 22:30
fish useful snippets
# Add to (fish) path
set -U fish_user_paths /usr/local/bin $fish_user_paths
set PATH (string match -v /usr/local/bin $PATH)
@JamieHouston
JamieHouston / python_cli
Created November 7, 2017 15:14
Start python cli with import
python -c "import mymodule, code; code.interact(local=locals())"
@JamieHouston
JamieHouston / reset_master
Last active August 30, 2017 17:41
sync fork with upstream
git fetch --all
# reset master to upstream/master
git checkout master
git reset --hard upstream/master
git push --force
# replay the patches (even they are rejected for now) on top of master
git checkout mybranch
git rebase master
@JamieHouston
JamieHouston / main.cs
Created August 18, 2017 14:27
New Public Gist
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
public class GithubRepository
{
public string Name { get; set; }
public string Description { get; set; }
public string Url { get; set; }
public string Homepage { get; set; }
@JamieHouston
JamieHouston / XUnit Vim Replacement Commands
Created June 30, 2017 21:03
Update MSTest/NUnit to XUnit
%s/Assert\.AreEqual(\(.*\), \(.*\))/\1.Should().Be(\2)/g
%s/Assert\.IsTrue(\(.*\))/\1.Should().BeTrue()/g
%s/Assert\.IsFalse(\(.*\))/\1.Should().BeFalse()/g
%s/Assert\.IsNull(\(.*\))/\1.Should().BeNull()/g
%s/Assert\.IsNotNull(\(.*\))/\1.Should().NotBeNull()/g
@JamieHouston
JamieHouston / main.cs
Last active December 14, 2016 18:29
Regex Servicestack Test
using System;
using System.Text.RegularExpressions;
using ServiceStack.Text;
var exp = @"([\@\[]*[\w, ]+[\]]*)";
var regex = new Regex(exp);
var parts = new List<string>{"This","is","@[my]","test","of","@[the]]",
"@[my]","test","for","@[[this]","@[bob wiley]",
"@is","@[my, comma]","the","end"};
@JamieHouston
JamieHouston / format_whitespace
Created December 5, 2016 21:52
Make all spaces and line endings the same
#! /usr/bin/env bash
# This script formats sources in Djinni with standard whitespace conventions.
# Specifically, tabs are converted to spaces (2 for Scala, 4 for other languages),
# and trailing whitespace is removed.
# This script is idempotent, so can be safely run on existing code without making changes.
set -eu
# Locate the script file. Cross symlinks if necessary.
loc="$0"
@JamieHouston
JamieHouston / .gitignore
Created September 25, 2016 20:18
gitignore file for visual studio
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
@JamieHouston
JamieHouston / main.cs
Last active August 15, 2016 16:53
Salesforce Dreamforce Sessions
using System;
using System.Linq;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
class SessionResponse
{
public string Name { get; set; }