Skip to content

Instantly share code, notes, and snippets.

View stormbeta's full-sized avatar

Jason Miller stormbeta

  • Ping Identity
  • Colorado
View GitHub Profile
@stormbeta
stormbeta / dark_horse_downloader.js
Created August 2, 2020 02:47 — forked from oxguy3/dark_horse_downloader.js
Greasemonkey script for downloading a DRM-free copy of your Dark Horse digital comics
// ==UserScript==
// @name Dark Horse Downloader
// @namespace http://schiff.io/
// @version 0.1
// @description Download a DRM-free copy of your Dark Horse digital comics.
// @author Hayden Schiff (oxguy3)
// @match https://digital.darkhorse.com/read/*
// @match https://digital.darkhorse.com/bookshelf*
// @include https://*.cloudfront.net/*// ==UserScript==
// @name Dark Horse Downloader
@stormbeta
stormbeta / kubeconfig_merger.sh
Last active October 18, 2018 17:15
Config Helper for kubectl
#!/usr/bin/bash
# Intended for use in your bashrc config
function reload-kubeconfigs {
# Combine kubeconfigs into ':'-delimited list as KUBECONFIG, which will be auto-merged by kubectl
local default="${HOME}/.kube/config"
local config_dir="${HOME}/.kube/config.d"
local config_paths=""
[[ ! -d "$config_dir" ]] && mkdir -p "$config_dir"
@stormbeta
stormbeta / sshrc.sh
Created November 16, 2016 22:38
ssh-agent-settings
function start_agent {
# Initialize new agent and add authentication
echo "Initialising new SSH agent..."
# Start authenticating daemon
# No authentications set up yet, just starting daemon!
ssh-agent | head -2 > ${SSH_ENV}
chmod 600 ${SSH_ENV}
# Find SSH_AUTH_SOCK and SSH_AGENT_PID of the available daemon
#
# This shell prompt config file was created by promptline.vim
#
function __promptline_last_exit_code {
[[ $last_exit_code -gt 0 ]] || return 1;
printf "%s" "$last_exit_code"
}
function blackConsole() {
document.querySelector(".console-output").style.backgroundColor = "black"
document.querySelector(".console-output").style.color = "white"
document.querySelector(".console-output").style.borderRadius = "5px"
document.querySelector(".console-output").style.padding = "10px 30px 30px"
}
window.onload = blackConsole
@stormbeta
stormbeta / dispatch.groovy
Created April 2, 2015 22:25
Dynamic dispatch weirdness in groovy
//TEST DYNAMIC DISPATCH
trait TraitOne { }
abstract class TypeOne implements TraitOne { }
class TypeTwo extends TypeOne { }
def method(TraitOne _) { return 'traitOne' }
def method(TypeOne _) { return 'typeOne' }
def method(TypeTwo _) { return 'typeTwo' }
def method2(TraitOne _) { return 'traitOne' }
@stormbeta
stormbeta / gist:8673133
Created January 28, 2014 18:17
Shell template interpolator
function render-template {
local template=`cat "${1}"`
local command=$(echo -e "cat <<EOF\n${template}\nEOF\n")
cat << EOF
$(eval "${command}")
EOF
}
@stormbeta
stormbeta / worm-scraper.rb
Created December 30, 2013 21:00
Simple script to scrape Worm web serial chapters into aggregate HTML
#!/usr/bin/ruby
# Scrapes crude HTML representation of Worm (Parahumans) web serial chapters
require 'rubygems'
require 'nokogiri'
require 'open-uri'
# URL of first chapter
nextChapterUri = URI::encode("http://parahumans.wordpress.com/category/stories-arcs-1-10/arc-1-gestation/1-01/")