Skip to content

Instantly share code, notes, and snippets.

View distractdiverge's full-sized avatar

Mx. Allie Lapinski distractdiverge

  • Willow Grove, PA
View GitHub Profile
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
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

@joeytwiddle
joeytwiddle / gist:6129676
Last active January 31, 2025 23:04
Deep population helper for mongoose
// Example usage:
// deepPopulate(blogPost, "comments comments._creator comments._creator.blogposts", {sort:{title:-1}}, callback);
// Note that the options get passed at *every* level!
// Also note that you must populate the shallower documents before the deeper ones.
function deepPopulate(doc, pathListString, options, callback) {
var listOfPathsToPopulate = pathListString.split(" ");
function doNext() {
if (listOfPathsToPopulate.length == 0) {
// Now all the things underneath the original doc should be populated. Thanks mongoose!
callback(null,doc);
@christophergorexyz
christophergorexyz / full-html-mirror.sh
Last active December 20, 2015 11:19
A wget command for mirroring a single domain. This will recursively retrieve every image, script, and stylesheet loaded or linked to through HTML and CSS. Will rename urls with query strings at the end to *.html files. Can't scrape dynamic requests, like AJAX. Doesn't necessarily play nicely with windows and may require some additional URL rewri…
wget -mkpE -e robots=off --no-cookies --no-cache $1
@distractdiverge
distractdiverge / XCodeReporter.js
Last active June 8, 2016 18:08
A custom reporter for jshint to present errors in a format for XCode to read them.
module.exports = {
reporter: function (res) {
var len = res.length;
var str = "";
res.forEach(function (r) {
var file = r.file;
var err = r.error;
str += file + ":" + err.line + ": error: " + err.reason + "\n";