Skip to content

Instantly share code, notes, and snippets.

View alan-morey's full-sized avatar

Alan Morey alan-morey

View GitHub Profile
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

public with sharing class AssertCallback {
private static Map<Type, IAssertCallback> callbacks = new Map<Type, IAssertCallback>();
public interface IAssertCallback
{
void assert(String location, Object state);
}
public static void assert(Type stateType, String location, Object state)
@afawcett
afawcett / ant-salesforce.xml
Last active December 29, 2022 17:11
Defines some macros around sf:deploy to install and uninstall packages.
<!-- TODO: Review Ant v1.8 local properties -->
<project xmlns:sf="antlib:com.salesforce">
<!-- Download from Salesforce Tools page under Setup -->
<typedef
uri="antlib:com.salesforce"
resource="com/salesforce/antlib.xml"
classpath="${basedir}/lib/ant-salesforce.jar"/>
<!-- Download from http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/ -->
@Osse
Osse / vdwrap
Last active October 18, 2022 18:06
Vimdiff wrapper for use with git difftool --dir-diff
#!/usr/bin/env zsh
# Configuration:
# $ git config --global diff.tool vdwrap
# If you don't put vdwrap somewhere in $PATH then either:
# $ git config --global difftool.vdwrap.cmd '/full/path/vdwrap $LOCAL $REMOTE'
# or:
# $ git config --global difftool.vdwrap.cmd 'vdwrap $LOCAL $REMOTE'
# $ git config --global difftool.vdwrap.path '/full/path'
#
@waylan
waylan / foo.sh
Created November 15, 2012 18:39
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""