Skip to content

Instantly share code, notes, and snippets.

@sehrgut
sehrgut / Kickstarter Spending Report README.md
Last active August 29, 2015 14:03
Kickstarter Spending Report

I wanted a quick way to see how much I'd spent on Kickstarter. These browser console scripts will convert all Kickstarter pledges to your home currency and add them up.

  1. Set homeCurr in xe.com.js and kickstarter.com.js to the same value.
  2. Run xe.com.js in a console window on http://xe.com.
  3. Set exchg in kickstarter.com.js to the output of step 2.
  4. Run kickstarter.com.js in a console window on https://www.kickstarter.com/profile/backings?ref=nav.

You should see something like:

@sehrgut
sehrgut / jquery.withStyles.js
Last active August 29, 2015 14:03
jQuery plugin to find elements based on computed CSS styles
/*
jquery.withStyles.js - jQuery plugin to find elements based on computed CSS styles
Copyright (C) 2014 Keith Beckman
Released under the GPLv3
## Usage
* Returns collection of all `a` tags with computed styles matching the CSS declaration
* `$('a:withStyles("font-style: bold; color: #FFFFFF;")')`
* `$('a').filter(':withStyles("font-style: bold; color: #FFFFFF;")')`
* `$('a').withStyles("font-style: bold; color: #FFFFFF;")`
@sehrgut
sehrgut / facebook-trending.abp
Created January 8, 2015 22:01
AdBlock Plus rule for Facebook "Trending" feed
@sehrgut
sehrgut / console.loghistory.js
Created June 24, 2015 20:01
console.log() with message history
console.log = (function (oldlog) {
var console_log = oldlog.bind(console);
var messages = [];
var newlog = function (msg) {
messages.push(msg);
console_log(msg);
};
@sehrgut
sehrgut / get-ebay-history.js
Created July 14, 2015 16:46
reads ebay purchase history from purchase history page
function getEbayHistory() {
var jq = jQuery([1]);
function parseItem(el) {
jq[0] = el;
var $title = jq.find('a.item-title');
return {
title: $title.text(),
url: $title.attr('href')
};
@sehrgut
sehrgut / gtm-cut.sh
Last active August 29, 2015 14:26
cuts a clip from a non-standard .mov file recorded by GoToMeeting
#!/bin/bash
function print_usage() {
cat <<EOF
Usage: `basename "$0"` --start time --length seconds --in path --out path
--start time: start time in 'HH:MM:SS.mmm' format
--length seconds: clip length in integer seconds
--in path: input file, must have '.mov' extension
--out path: output file, must have '.mov' extension
@sehrgut
sehrgut / console.log-uncaught.js
Created November 24, 2015 17:22
logs uncaught exceptions which bubble up to window.onerror
window.onerror = (function () {
var old_err = window.onerror;
var new_err = function (msg, url, line, col, err) {
console.log("Line " + line + ":" + col + " - " + msg);
if (typeof err.stack !== 'undefined')
console.log(err.stack);
else
console.log(err);
@sehrgut
sehrgut / inheritance-patterns.js
Created April 30, 2013 03:42
Notes in search of the One True Javascript Inheritance Pattern, ideally with minimal boilerplate and no helper functions.
// http://www.bennadel.com/blog/2184-Object-create-Improves-Constructor-Based-Inheritance-In-Javascript-It-Doesn-t-Replace-It.htm
var SuperType = function () {
};
SuperType.prototype = {};
var SubType = function () {
@sehrgut
sehrgut / squint.sh
Last active December 17, 2015 17:19
squint - a bash script for cygwin to rip audio tracks from YouTube video files wihtout transcoding
#!/usr/bin/bash
# Licensed under any of GPLv2, MIT, and BSD 2-clause licenses
FFDIR=`cygpath -u $USERPROFILE`"/bin/ffmpeg/bin"
infile=`cygpath -w "$1"`
outfile=`cygpath -w "${1%.*}"`
echo $1
FFPROBE="$FFDIR/ffprobe.exe"
@sehrgut
sehrgut / libertarians.md
Created July 8, 2013 22:21
some google zeitgeist about us crazy libertarians, from my current node.js project "googlesay".

#Google Say

##about "libertarians are just"

  • "Libertarians are just radical Right-wingers who have not one care for anything or anyone other than themselves." *
  • "The Libertarians are just the Antinomians of the modern age." *
  • "6 Comments to �Libertarians Are Just Republicans Who Smoke Pot�." *
  • "His entire piece is premised upon the idea that libertarians are just another element of the Right that simply needs to be brought back into the..." *
  • "Also, it gives credence to allegations from liberals that libertarians are just conservatives in disguise." *
  • "Otherwise, libertarians are just " all the