Skip to content

Instantly share code, notes, and snippets.

@JoeRobich
JoeRobich / CsGuard.cs
Created March 13, 2014 14:03
Port of AsGuard to C#.
using System;
using System.Collections.Generic;
namespace TheDevStop.CsGuard
{
public class Contracts
{
public enum Kind
{
PreCondition,
@JoeRobich
JoeRobich / UITask.cs
Last active August 29, 2015 14:01
Class to simplify running tasks on the UI thread.
using System;
using System.Threading.Tasks;
using Windows.ApplicationModel.Core;
using Windows.UI.Core;
namespace TheDevStop.Mobile.Framework
{
public class UITask
{
static readonly CoreDispatcher _dispatcher;
@JoeRobich
JoeRobich / Func.cs
Created June 20, 2014 19:35
Methods that allow partial application of arguments to a function.
public class Func
{
//Two Params
public static Func<T2, TR> Apply<T1, T2, TR>(Func<T1, T2, TR> func, T1 arg1)
{
return (arg2) => func(arg1, arg2);
}
//Three Params
public static Func<T2, T3, TR> Apply<T1, T2, T3, TR>(Func<T1, T2, T3, TR> func, T1 arg1)
@JoeRobich
JoeRobich / HipChatAppendFix.js
Created July 24, 2014 16:29
This is a GreaseMonkey script that fixes HipChat's annoying behavior of breaking up multiple consecutive chats into different chat blocks.
// ==UserScript==
// @name       HipChat append fix
// @namespace  http://joeyrobichaud.com/
// @version    0.1
// @description  Sending multiple messages in a row will create multiple chat blocks even though you are the sender of each of them. this fixes that.
// @match      https://*.hipchat.com/chat
// @copyright  2014+, Joey Robichaud
// ==/UserScript==
window.addEventListener("load", function(e) {
@JoeRobich
JoeRobich / jsFaddle.html
Last active August 29, 2015 14:05
jsFaddle Bookmark
data:text/html,<title>jsFaddle</title><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/codemirror.min.css"/><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/theme/vibrant-ink.css"/><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/hint/show-hint.css"/><link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/lint/lint.css"/><script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/codemirror.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/hint/show-hint.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/hint/anyword-hint.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/hint/xml-hint.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/codemirror/4.4.0/addon/hint/html-hint.js"></script><script src="http://cdnjs.cloudflare.com/ajax/libs/cod
@JoeRobich
JoeRobich / VInkStyle.json
Last active August 29, 2015 14:08
The Vink theme is a modified WikiRoad Ink theme for Xamarin Studio/MonoDevelop.
{
"name": "VInk",
"version": "1.0",
"description": "The Vink theme is a modified WikiRoad Ink theme.",
"originator": "Joey Robichaud <joey.robichaud@gmail.com>",
"palette": [
{ "name": "comment", "value": "#808080" },
{ "name": "keyword", "value": "#CC7832" },
{ "name": "type", "value": "#FFC66A" },
{ "name": "interface", "value": "#6897BB" },
@JoeRobich
JoeRobich / MainWindow.mxml
Created March 4, 2015 23:37
WPF AttachedProperty to show the on-screen keyboard when the control get focused by touch then hide it when the control loses focus. Code in this Gist is MIT Licensed.
<Window x:Class="TouchKeyboardTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TouchKeyboardTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="Touch Keyboard Test"
@JoeRobich
JoeRobich / DarkCodeForHipChatBeta
Last active August 29, 2015 14:16
DarkCode Stylish script to for the new HipChat Beta redesign
@-moz-document domain("hipchat.com") {
.date-divider {
margin: 0;
text-align: left;
color: #fff;
}
.date-block {
width: calc(100% - 10px);
}
@JoeRobich
JoeRobich / Vink.tmTheme
Last active September 16, 2015 19:18
Vink for VsCode v0.8
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Vink</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@JoeRobich
JoeRobich / Settings.vb
Created August 11, 2011 20:38
The Visual Studio macros for creating a Settings menu/toolbar.
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Public Module Settings
Private Const FONT_SIZE_CATEGORY As String = "FontsAndColors"