Skip to content

Instantly share code, notes, and snippets.

@samsalisbury
samsalisbury / .gitconfig
Last active June 22, 2022 19:30
Git diff and merge with p4merge (OSX)
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
@samsalisbury
samsalisbury / monadicTimeout.js
Created June 13, 2012 16:31
JavaScript monadic timeout (jQuery plugin)
// Provides safe way to ensure that you only have a single timeout
// set for a particular event, in the face of browsers not always
// firing the expected events...
// Usage example:
//
// var myTimeout = $.monadicTimeout(function() { doSomething(); }, 500);
//
// $(".some-class").mouseenter(myTimeout.clear);
// $(".some-class").mouseleave(myTimeout.set);
@brianlow
brianlow / FindConflictingReferences.cs
Created January 3, 2012 03:04
Find conflicting assembly references
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MyProject
{
[TestFixture]
@samsalisbury
samsalisbury / linear-gradient.less
Created November 4, 2011 17:03
dotLess CSS gradient mixin...
/*
Based on output from http://www.colorzilla.com/gradient-editor/
*/
.linear-gradient(@r1, @g1, @b1, @a1, @p1, @r2, @g2, @b2, @a2, @p2, @r3, @g3, @b3, @a3, @p3, @r4, @g4, @b4, @a4, @p4) {
background: rgb(@r1,@g1,@b1);
background: -moz-linear-gradient(top,
rgba(@r1,@g1,@b1,@a1) @p1,