This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stop all containers: | |
docker stop $(docker ps -q) | |
# remove all containers: | |
docker rm $(docker ps -a -q) | |
# remove all docker images: | |
docker rmi $(docker images -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[filter "hawser"] | |
clean = git hawser clean %f | |
smudge = git hawser smudge %f | |
required = true | |
[user] | |
name = John Gilliland | |
email = [email protected] | |
[filter "lfs"] | |
process = git-lfs filter-process | |
clean = git-lfs clean -- %f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From the OpenRA Game Engine I was reading the code and found this nice enum ext! | |
public static class Enum<T> | |
{ | |
public static T Parse(string s) { return (T)Enum.Parse(typeof(T), s); } | |
public static T[] GetValues() { return (T[])Enum.GetValues(typeof(T)); } | |
public static bool TryParse(string s, bool ignoreCase, out T value) | |
{ | |
// The string may be a comma delimited list of values | |
var names = ignoreCase ? Enum.GetNames(typeof(T)).Select(x => x.ToLowerInvariant()) : Enum.GetNames(typeof(T)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#################### | |
# file_renamer.py | |
# [email protected] | |
# | |
import os, glob, re | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TaskExtensions | |
{ | |
/// <summary> | |
/// Executes the next task after the completion of the first. | |
/// </summary> | |
/// <param name="first">Currently executing task.</param> | |
/// <param name="next">Function returning the task to execute next.</param> | |
/// <returns>The next task instance.</returns> | |
public static Task Then(this Task first, Func<Task> next) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ProcessStartInfoExtensions | |
{ | |
public const int WaitForExitMilliseconds = 500; | |
/// <summary> | |
/// Starts a process with support for cancellation via the | |
/// provided token. Console output for the process is redirected | |
/// to the provided delegates. | |
/// </summary> | |
/// <param name="processStartInfo"><see cref="ProcessStartInfo" /> instance.</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem .\ -include bin, obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in wsl use this: | |
python -m SimpleHTTPServer | |
# but in windows use this: | |
python -m http.server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rm -r --cached . | |
git add . | |
git commit -m "updated .gitignore is now working" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Copy of https://gist.github.com/redthor/3776c1f726cafff41c9eda6f271466c3 | |
### Adding in comments explaining each line/command in order to help learning | |
### Set DRY_RUN=1 to only echo the commands instead of executing them | |
#DRY_RUN=1 | |
OlderNewer