Skip to content

Instantly share code, notes, and snippets.

View jrusbatch's full-sized avatar

Justin Rusbatch jrusbatch

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
public static void Win()
{
Console.Beep(659, 125);
Console.Beep(659, 125);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
public class Mario
{
public void Win()
{
@echo Off
:: If an existing file is specified, open that file. Otherwise, search the
:: current directory for a solution file to open. If a solution file is not
:: found, don't do anything.
@set VS_LAUNCHER="%PROGRAMFILES(X86)%\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe"
@set VS_PATH="%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"
@set TARGET="%1"
#!/usr/bin/env bash
if [ ! -d ".git" ]; then
echo "Directory is not a repository."
exit 1
fi
if [ ! -f ".gitattributes" ] && [ -f "../gitattributes" ]; then
cp ../gitattributes .gitattributes && git add .gitattributes && git commit -m "Create .gitattributes"
git rm -r --cached .
@jrusbatch
jrusbatch / job.cs
Last active August 29, 2015 14:08 — forked from clairernovotny/job.cs
internal class Job : IDisposable
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
static extern IntPtr CreateJobObject(IntPtr a, string lpName);
[DllImport("kernel32.dll")]
static extern bool SetInformationJobObject(IntPtr hJob, JobObjectInfoType infoType, IntPtr lpJobObjectInfo, UInt32 cbJobObjectInfoLength);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool AssignProcessToJobObject(IntPtr job, IntPtr process);
public IEnumerable<T> ConquerFile<T>(Stream stream)
{
using (var reader = new PeekableTextReader(stream))
{
// find how big of an army we need
var conscriptInfo = _contextSurvey.AllOfTheLands<T>(reader);
// marshal the troops
var formation = _fileHelpersTypeDrafter.BuildPhalanx<T>(conscriptInfo);
@echo Off
:: If an existing file is specified, open that file. Otherwise, search the
:: current directory for a solution file to open. If a solution file is not
:: found, don't do anything.
@set VS_LAUNCHER="%PROGRAMFILES(X86)%\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe"
@set TARGET="%1"
@jrusbatch
jrusbatch / .gitconfig
Created September 21, 2016 15:55
Git Config as of 2016-09-21
[alias]
amend = commit -a --amend
bclean = "!f() { git branch --merged ${1-master} | grep -v ${1-master}$ | xargs -n 1 git branch --delete; }; f"
bprune = "!f() { echo $(git branch -r --merged | grep origin | grep -v master | grep -v development | xargs -L1 | cut -d / -f2-) | tr '\n' ' ' | xargs -n 1 git push origin --atomic --delete; }; f"
branches = branch -avv
c = clone --recursive
ca = !git add -A && git commit -av
co = checkout
d = diff --patch-with-stat
fetch-pr = "!f() { git fetch -fu $1 refs/pull/$2/head:pull-$2; }; f"
@jrusbatch
jrusbatch / Job.cs
Created September 28, 2016 17:11 — forked from clairernovotny/Job.cs
Job objects in .NET
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
internal class Job : IDisposable
{
public static class DatabaseFactory
{
private static ISqlLocalDbInstance GetInstance()
{
var provider = new SqlLocalDbProvider();
return provider.GetInstance("v13.0");
}
public static IDatabase CreateDatabase()
{