Skip to content

Instantly share code, notes, and snippets.

View martindale's full-sized avatar
🚀
relentless maker.

Eric Martindale martindale

🚀
relentless maker.
View GitHub Profile
@martindale
martindale / gist:3895718
Created October 15, 2012 21:38 — forked from chrisinajar/gist:3889750
better chat window
// Make a bookmark with this in it:
javascript:(function(){$("#button-chat-expand").click(function() {$("#chat").animate({top:0})}); $("#button-chat-collapse").click(function() {$("#chat").animate({top:285})});$("#chat").css($("#playback").position()).width(842);$("#chat-messages").width(823); $.each(document.styleSheets, function(i, styleSheet) { $.each(styleSheet.cssRules, function(j, rule) { if (rule.selectorText == '.chat-message, .chat-mention, .chat-emote, .chat-skip, .chat-moderation, .chat-system, .chat-update' || rule.selectorText == '.chat-superuser' || rule.selectorText == '.chat-moderator') rule.style.width = '788px'; })});})();
@martindale
martindale / jarplug.js
Created October 16, 2012 00:26
jarplug phantomjs beginnings
var page = require('webpage').create();
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.onLoadFinished = function(status){
if ('success' === status)
{
@martindale
martindale / plug.fm.js
Created October 16, 2012 00:54 — forked from pantlesswonder/plug.fm.js
plug.fm phantomjs
// Get twitter status for given account (or for the default one, "PhantomJS")
var page = require('webpage').create(),
twitterUsername = '',
twitterPassword = ''; //< default value
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
page.onConsoleMessage = function(msg) {
console.log(msg);
};
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.1
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
var cook = setInterval(function() { $('#make_btn').click() }, 8)
var sell = function() {
var sellInt = setInterval(function() {
if(parseInt($('#make_amt').text()) > 0) {
$('#sell_btn').click()
}
else {
clearInterval(sellInt);
return;
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
<
%3C
&lt
&lt;
&LT
&LT;
&#60
&#060
&#0060
&#00060
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh

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