Skip to content

Instantly share code, notes, and snippets.

View ChrisMissal's full-sized avatar
💭
set status

Chris Missal ChrisMissal

💭
set status
View GitHub Profile

We're doing a small year-end news nerd countdown on Source. Lists are too much, so please send us ONE THING—an app, a tool, an article, a tweet, an image, a map, or something else entirely—that you loved this year. Might be something that made your job easier or made you smarter, or it might have more obscure relevance. All we ask is that you can link to it.

Don't think too hard about it, just take 30 seconds and send one in now to [email protected]. We'll be posting an assembly of favorite things and all we can say about it right now is that there will be GIFs.

[email protected]

Wooo.

@beaugunderson
beaugunderson / Default (OSX).sublime-keymap
Created January 23, 2014 23:22
Sublime Text macros for converting to and from 2 and 4 space indentation
[
{
"keys": ["ctrl+2"],
"command": "run_macro_file",
"args": {
"file": "Packages/User/to-2.sublime-macro"
}
},
{
"keys": ["ctrl+4"],
anonymous
anonymous / gist:ec2a02e7d2e6011074be
Created May 6, 2014 19:19
Execute async method synchronously
internal static class AsyncHelper {
private static readonly TaskFactory taskFactory = new TaskFactory(CancellationToken.None, TaskCreationOptions.None, TaskContinuationOptions.None, TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func) {
return taskFactory.StartNew(func).Unwrap().GetAwaiter().GetResult();
}
public static void RunSync(Func<Task> func) {
taskFactory.StartNew(func).Unwrap().GetAwaiter().GetResult();
}
@jrunning
jrunning / server.rb
Created June 30, 2014 18:10
Instant Ruby CGI server
#!/usr/bin/env ruby
require "webrick"
server = WEBrick::HTTPServer.new(Port: 8080, DocumentRoot: Dir::pwd)
trap("INT") { server.shutdown }
server.start
@ventaur
ventaur / Enumeration.cs
Created August 22, 2014 22:29
Small modifications to Headspring Enumeration and HTML conventions to support drop-downs for them
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using FubuCore.Util;
namespace My.Core.Domain.Models {
@KevM
KevM / measureme.cs
Created February 18, 2015 19:47
Wrote this quick little performance testing harness. Guessing this is a C# right of passage kind of thing.
public static void MeasureMe(Action action, int count=100, int warmup = 10, int runs = 1,string messageFormat = "It took {0}ms to do this.")
{
Enumerable.Range(0, warmup).Each(i =>
{
action();
});
Enumerable.Range(0, runs).Each(r =>
{
var watch = new Stopwatch();
@jayotterbein
jayotterbein / sln.ps1
Last active June 4, 2018 21:36
Open solution file in current directory with most recent visual studio
Function sln([string]$hintPath = $null)
{
[string[]]$installed = @(gci HKLM:\Software\Microsoft\VisualStudio\) |% { $_.Name } |% { Split-Path $_ -Leaf }
$versions = @()
foreach ($i in $installed)
{
[Version]$v = "0.0"
if ([Version]::TryParse($i, [ref]$v))
{
$versions += $v
@plioi
plioi / Retry.cs
Last active August 29, 2015 14:17
Fixie Convention - Retry on SQL Timeouts
public class IntegrationTestConvention : Convention
{
public IntegrationTestConvention()
{
Classes
.NameEndsWith("Tests");
Methods
.Where(method => method.IsVoid() || method.IsAsync());
@RohanBhanderi
RohanBhanderi / Git_mergetool_commands
Last active February 24, 2025 18:08
Git Mergetool and difftool with Beyond Compare 4
//Git Mergetool and difftool with Beyond Compare 4
//For Windows
//IF running this command in git bash then escape $ with \
git config --global diff.tool bc4
git config --global difftool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\""
git config --global difftool.prompt false
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd "\"C:/Program Files (x86)/Beyond Compare 4/BCompare.exe\" \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
git config --global mergetool.bc4.trustExitCode true
@maydaytx
maydaytx / BowlingSchedule.cs
Last active July 30, 2019 18:20
Randomly select bowlers to exclude each week
void Main()
{
const int weeks = 12;
const int bowlersPerWeek = 4;
var bowlers = new[]
{
new Bowler("Bob", 5, 8),
new Bowler("Ben", 2),
new Bowler("Janna", 5),