Skip to content

Instantly share code, notes, and snippets.


Chris F Carroll chrisfcarroll

Block or report user

Report or block chrisfcarroll

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4596103
~/Software/Clojure/pallet-crate-tomcat7-demo]lein run
16:35:14.723 [main] DEBUG pallet.compute.jclouds - extensions (:slf4j :sshj)
16:35:14.734 [main] DEBUG pallet.compute.jclouds - options []
16:35:17.279 [main] DEBUG pallet.core - pallet version: 0.7.2
16:35:17.290 [main] INFO pallet.core - retrieving nodes
16:35:23.639 [main] INFO pallet.core - lift-nodes phases [:destroy-server], groups []
Exception in thread "main" java.lang.NumberFormatException: Invalid number: 09
at clojure.lang.LispReader.readNumber(
at clojure.lang.RT.readString(
chrisfcarroll / tmMakeImage
Last active May 6, 2019
A commandline script for MacOS, to create a TimeMachine Backup Volume on a non-Apple formatted disk
View tmMakeImage
# 2015 Updates to sunkid's script. chrisfcarroll
# - added more quote marks to cope with e.g. spaces in volume names.
# - get machine UUID from ioreg instead of parsing and system report.
# - added steps to tell Time Machine to use your new backup drive.
# - renamed.
# Make it executable with e.g. chmod a+x tmMakeImage && mv tmMakeImage /usr/local/bin.
# A bash script to create a time machine disk image suitable for
# backups with OS X 10.6 (Snow Leopard) and later.
View trello-wrap-n-stack-to-fit.user.js
// ==UserScript==
// @name Trello Wrap-n-Stack-To-Fit
// @namespace
// @version 0.73
// @description Trello: Auto-wrap, stack and resize your Trello lists so they don't go offscreen. And kill that horizontal scroll-bar.
// @author chrisfcarroll
// @match*
// @grant none
// ==/UserScript==
// jshint -W097
chrisfcarroll / QUnitTestIf.cshtml
Last active Feb 14, 2016
An Asp.Net MVC PartialView for in-browser page testing. Makes it possible to test complex UIs and widgets 'in situ' but with zero client-side pageweight in production.
View QUnitTestIf.cshtml
@model IEnumerable<string>
@if (Request.IsLocal
&& ( Request.QueryString["test"]!=null
<div id="unit-tests">
<script src='~/scripts/qunit-1.20.0.js'></script>
chrisfcarroll / Cacher.cs
Last active Feb 19, 2016
A simple memoizer backed by System.Runtime.Caching.MemoryCache.Default
View Cacher.cs
using System;
using System.Reflection;
using System.Runtime.Caching;
/// <summary>Memoize the results of method calls.</summary>
class Cacher
public readonly string UniqueName;
public readonly int CacheTimeSeconds;
chrisfcarroll / gist:28fc739fb63d19f242d1
Created Feb 5, 2016
Stub or Mock, as far as possible, the Asp.Net MVC controller HttpContext and also System.Web.HttpContext.Current
View gist:28fc739fb63d19f242d1
public partial class HttpRequestOverridableWrapper : HttpRequestWrapper
readonly string appVirtualDir;
public HttpRequestOverridableWrapper(HttpRequest httpRequest, string appVirtualDir)
: base(httpRequest)
this.appVirtualDir = appVirtualDir;
public override string ApplicationPath { get { return appVirtualDir; } }
chrisfcarroll / AutoHotKey for a Mac User with an Apple keyboard on Windows.ahk
Last active Jul 13, 2019
AutoHotKey script for they who, being Mac Users with an Apple keyboard, yet still insist on using Windows. Also some arrange-windows-on-a-big-screen keys . Takes a similar approach as Parallels to keyboard mapping: rather than a wholesale swap of Cmd <-> Ctrl, instead duplicate favourite ctrl-key shortcuts to the Cmd key. For the big screen: som…
View AutoHotKey for a Mac User with an Apple keyboard on Windows.ahk
; Language: English
; Uses unicode. Save this file as utf-8 with BOM.
; Else it shall not work.
#NoEnv ; Recommended
;SendMode Input ; Recommended
SendMode Event
SetWorkingDir %userprofile% ; Ensures a consistent starting directory.
chrisfcarroll / Asp.Net MVC DebuggableModelBinder and
Last active Sep 13, 2018
To make stepping through the modelbinding process easier
View Asp.Net MVC DebuggableModelBinder and

Use the DebuggableModelBinder with a breakpoint to investigate what's happening when your complex model isn't binding as you expect.

Use the CheckBoxToBoolModelBinder to bind <input type="checkbox" > Note the Html standard describes "on" as the only valid postable value for a checkbox.. If you're posting something else, change the code. And don't that forget that unchecked means that nothing gets posted.

In either case, wire them up with e.g.:

public class MvcApplication : HttpApplication
    protected void Application_Start()
View Minimal html5 doc
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>title</title></head><body>Here</body></html>
View WrappingAsyncInAsyncAwaitIsRedundant.cs
// Example 1) async await is redundant when calling a method that doesn't block anyway
void Main()
var filename = Path.Combine(Path.GetTempPath(), "ExampleAsyncAwaitIsRedundant.txt");
using (var fstream= new FileStream(filename,FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 4096,FileOptions.Asynchronous))
fstream.Seek(0, SeekOrigin.Begin);
You can’t perform that action at this time.