Skip to content

Instantly share code, notes, and snippets.

@spig
spig / goto-xquery-module.vim
Created February 22, 2017 07:44
go to module/declare with vim
function! GetXqueryNamespace()
normal! yiw
return split(split(@", ":")[0], '\$')[0]
endfunction
function! GetXqueryDeclare()
normal! yiw
return split(@", ":")[1]
endfunction
@spig
spig / delete-kindle-book-annotations.js
Last active December 28, 2016 20:20
delete a kindle book's annotations
// run on https://kindle.amazon.com/your_highlights
// find asin in the form for a delete on the book you want to remove highlights for
var asin = "B00BNGXNW2";
$('form > input[value="'+asin+'"]').each(function(index, input) {
var form = input.closest('form');
var action = $(form).attr('action');
var auth = $(form).find("input[name=authenticity_token]").attr('value');
//var asin = $(form).find("input[name=asin]").attr('value');
var annid = $(form).find("input[name=annotation_id]").attr('value');
@spig
spig / webm from ts
Last active December 5, 2016 14:40
for i in *.ts; do filename=$(basename $i); base=${filename%.*}; ffmpeg -i $filename -ss 00:03:00.000 -t 00:00:30.000 -c:v libvpx -b:v 1M -c:a libvorbis $base.webm; done
for i in *.ts; do filename=$(basename $i); base=${filename%.*}; ffmpeg -i $filename -c:v libx264 -c:a libfaac -vf scale=-1:720 -q:a 100 -ac 2 $base.mp4; done
ffmpeg -i 1112_20161129185900.ts -ss 00:03:00.000 -t 00:00:30.000 -c:v libvpx -b:v 1M -c:a libvorbis 1112_20161129185900.webm
// ==UserScript==
// @name Remove Kids Accounts from Total Balance
// @namespace http://stevespiga.rel.li/
// @version 0.2
// @description remove kid account balances from total balances - money and savings
// @author Steve Spigarelli
// @match https://secure.capitalone360.com/myaccount/banking/account_summary.vm
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Hide Rated R Movies on Feature Films page
// @namespace http://stevespiga.rel.li/
// @version 0.1
// @description try to take over the world!
// @author Steve Spigarelli
// @match https://www.slcolibrary.org/mm/mmmo/newFeatureFilms.htm
// @grant none
// ==/UserScript==
@spig
spig / gist:d66a3aa81f7c96d4a035976936e6f679
Created October 12, 2016 21:17
Remove all songs from wish list on freegalmusic.com
$("div.wishlistsong").each(function(index, wsl) { $.post("/homes/removeWishlistSong/", { ajax: 1, delete: wsl.id.replace('wishlistsong-', '') })});
@spig
spig / http-get-lines-from-file.sh
Created April 23, 2014 22:55
http get lines from a file and output as filename
while read line ; do
echo $line ; http --ignore-stdin GET https://host$line > `basename $line`
done < images.txt
@spig
spig / turnoffretweets
Created March 9, 2013 04:41
Turn off all retweets on twitter. Run this in javascript console.
$(".retweet-off-text").each(function() { $(this).click(); });