Skip to content

Instantly share code, notes, and snippets.

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Sep 21, 2021
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

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

View edd-heartbeat-demo.php
<?php
/**
* Plugin Name: EDD Heartbeat API test plugin
* Description: Demonstrates how to use the Heartbeat API to update the payments count on the dashboard
*/
// Load the heartbeat JS
function edd_heartbeat_enqueue( $hook_suffix ) {
// Make sure the JS part of the Heartbeat API is loaded.
wp_enqueue_script( 'heartbeat' );
@klovadis
klovadis / gist:5170446
Created Mar 15, 2013
Two Lua scripts for Redis to turn HGETALL and HMGET into dictionary tables
View gist:5170446
-- gets all fields from a hash as a dictionary
local hgetall = function (key)
local bulk = redis.call('HGETALL', key)
local result = {}
local nextkey
for i, v in ipairs(bulk) do
if i % 2 == 1 then
nextkey = v
else
result[nextkey] = v
@tollmanz
tollmanz / gist:4138257
Created Nov 24, 2012
Easy sync for git and svn repo
View gist:4138257
# -s assumes normal branches/tags/trunk structure
git svn clone -s http://svn.my.little.repo.com
# Add the git repo
git remote add git-repo git@github.com:tollmanz/my-little-repo.git
# Pull in the git remote
git fetch git-repo
# Create new tracking branch
@dahu
dahu / gist:3986511
Last active Jul 26, 2021
Vim Motions
View gist:3986511
Large Object Motions:
(
)
{
}
[[
[]
][
]]
[m
@Stubbs
Stubbs / install_jenkins.sh
Created Feb 3, 2012
Script to install everything you need for PHP CI on a Debian box.
View install_jenkins.sh
#!/bin/bash
## Install Git #########################################
apt-get install git
## Install Ant #########################################
apt-get install ant
## Install Jenkins #####################################