Skip to content

Instantly share code, notes, and snippets.

View aggieben's full-sized avatar
🏠
Working from home

Ben Collins aggieben

🏠
Working from home
View GitHub Profile
@aggieben
aggieben / sh_env_var_opts.sh
Created October 1, 2015 00:52 — forked from KylePDavis/sh_env_var_opts.sh
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.country {
fill: #b8b8b8;
stroke: #fff;
stroke-width: .5px;
stroke-linejoin: round;
}
# this is required
Import-Module pscx
# just drop this into your $profile, somewhere after the above import-module line
function With-Env (
[string[]]$vars,
[Parameter(Position=1)]
[scriptblock]$f
) {
Push-EnvironmentBlock
 * Package: dev-lang/mono-3.12.1
 * Repository: dotnet
 * Maintainer: dotnet@gentoo.org
 * USE: abi_x86_64 amd64 elibc_glibc kernel_linux nls userland_GNU
 * FEATURES: preserve-libs sandbox userpriv usersandbox
* Determining the location of the kernel source code
* Found kernel source directory:
* /usr/src/linux
* Found kernel object directory:
* /lib/modules/4.0.5-gentoo/build
@aggieben
aggieben / app.js
Last active August 29, 2015 14:22
SCA-screen
(function() {
function makeImg(url) {
var result = new Image();
result.src = url;
return result;
}
var images = [
makeImg("http://i.imgur.com/nm0PtVD.jpg"),
makeImg("http://i.imgur.com/uxaHo7Z.jpg"),
// ==UserScript==
// @name Herald Banner Unblocker
// @namespace http://github.com/aggieben
// @version 0.1
// @description get rid of the super-annoying paywall
// @match http://www.heraldbanner.com/*
// @copyright 2015+, You
// @run-at document-end
// @grant GM_log
// ==/UserScript==
@aggieben
aggieben / zh.html
Created October 16, 2014 19:11
en/zh test
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8"/>
<style type="text/css">
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td
{
margin: 0px;
padding: 0px;
border: 0px none;
@aggieben
aggieben / fidatagetter.user.js
Last active August 29, 2015 14:02
Get CSV for Fidelity => YNAB
// ==UserScript==
// @name FI Data Getter
// @namespace https://github.com/aggieben
// @version 0.1.2
// @description Download table of transactions as OFX
// @match https://*.ibsnetaccess.com/*
// @author Benjamin Collins
// @copyright 2013, Benjamin Collins
// @require http://code.jquery.com/jquery-1.10.2.min.js
// @require https://raw.githubusercontent.com/alexei/sprintf.js/master/dist/sprintf.min.js
// ==UserScript==
// @name Show Deleted Chat Messages
// @namespace https://gist.github.com/aggieben
// @version 0.2.2
// @description show deleted messages on chat.*.stackexchange.com and chat.(*.\.)stackoverflow.com
// @match *://chat.meta.stackexchange.com/*
// @match *://chat.stackexchange.com/*
// @match *://chat.stackoverflow.com/*
// @copyright 2012+, Ben Collins
mount -t proc proc /mnt/gentoo/proc; mount --rbind /sys /mnt/gentoo/sys; mount --rbind /dev /mnt/gentoo/dev; chroot /mnt/gentoo /bin/bash;
source /etc/profile; export PS1="(chroot) $PS1"
cd; umount -l /mnt/gentoo/dev{/shm,/pts,}; umount -l /mnt/gentoo{/boot,/proc,}