Skip to content

Instantly share code, notes, and snippets.

View m1kc's full-sized avatar

Max Musatov m1kc

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

@ozten
ozten / Fauxgermanhausen_bookmarklet.js
Created April 30, 2013 21:54
Fauxgermanhausen das Pagen! Bookmarklet
javascript:(function(){var%20prefixes=['','glocken','das','borfa','maushe','uber'],suffixes=['','hausen','%20die%20vander','gleuten','noshan','flagellan','mek','dak','en%20das','ga'],xPathResult=document.evaluate('.//text()[normalize-space(.)!=\'\']',document.body,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),i,textNode,cnt,out,j,pfx,sfx;for(i=0,l=xPathResult.snapshotLength;i<l;i++){textNode=xPathResult.snapshotItem(i);if(textNode.parentNode.nodeName.toLowerCase()=='script'||textNode.tagName=='style')continue;cnt=textNode.data.split(/\s/g);out=[];for(j=0;j<cnt.length;j++){if(cnt[j].replace(/[\s]/g,'')=='')continue;pfx=(!Math.floor(Math.random()*10))?'':prefixes[Math.floor(Math.random()*prefixes.length)];sfx=(!Math.floor(Math.random()*10))?'':suffixes[Math.floor(Math.random()*suffixes.length)];out.push(pfx+cnt[j]+sfx);}textNode.data='%20'+out.join('%20')+'%20';}})();
@jeremyroman
jeremyroman / Makefile
Created December 12, 2012 19:26
llvm/brainfuck: Complete
PROGRAM := llvm-brainfuck
OBJECTS := main.o
SHIM := shim.a
SHIM_OBJECTS := shim.o
CC := clang
CXX := clang++
CXXFLAGS := $(shell llvm-config --cppflags) -Wall -Werror -pedantic
LDFLAGS := $(shell llvm-config --ldflags --libs core)
@m1kc
m1kc / setLookAndFeel.java
Created August 9, 2012 20:10
setLookAndFeel()
private static void setLookAndFeel()
{
// Well, let's try to set Nimbus explicitly first.
try
{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
System.out.println("LaF: com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
return; // success
}
catch(Throwable ex)