Skip to content

Instantly share code, notes, and snippets.

View soulshake's full-sized avatar

AJ Bowen soulshake

View GitHub Profile
@soulshake
soulshake / Italy's Invading Army.md
Last active November 17, 2019 09:14
Transcription of article printed in The Sun (New York) 28 Jun 1891

Italy's Invading Army

The Sun (New York) 28 Jun 1891

They are Coming Here More Rapidly than Immigrants from Any Other Land--Barge Office Authorities Rank Them Low In Comparison With Other Nationalities--Conflicting Reports About Their Subsequent Manner of Life in America--[...]--Ten Male Italians to One Female the Proportion of the Sexes Coming Here---How Many Return to Italy With American Dollars?

The rate at which the impoverished subjects of the King of Italy are crowding through all our national turnstiles suggests an inquiry into the aims and subsequent manner of life of the hordes that are rapidly becoming a large factor in our body politic. Italians are coming to America now in vastly greater numbers than ever before, [...]

@soulshake
soulshake / test_no_404.py
Last active April 23, 2019 09:41 — forked from andresriancho/test_no_404.py
Check for broken links in your django site in a unittest!
import subprocess
import unittest
import re
import shlex
import os
import time
FNULL = open(os.devnull, 'w')
@soulshake
soulshake / py3status-timezones.py
Created May 2, 2017 00:00
Not really fully working but semi-close maybe way to display a clickable series of timezones in i3 status bar
# -*- coding: utf-8 -*-
"""
Cycle Timezones
py3status module that manually cycles through a set of timezones when clicked.
Configuration parameters:
format: Initial format to use
(default "")
format_clicked: Display format to use when we are clicked
@soulshake
soulshake / aws-cf-list-stacks-by-region.sh
Created January 9, 2017 19:17
List cloudformation stacks in all Convox-supported AWS regions.
#!/bin/bash
REGIONS="
ap-northeast-1
ap-southeast-1
ap-southeast-2
eu-central-1
eu-west-1
us-east-1
us-east-2
@soulshake
soulshake / diff2html.sh
Created November 3, 2016 21:16 — forked from stopyoukid/diff2html.sh
Script that takes a git diff and outputs an html file in GitHub style
#!/bin/bash
#
# Convert diff output to colorized HTML.
# (C) Mitch Frazier, 2008-08-27
# http://www.linuxjournal.com/content/convert-diff-output-colorized-html
# Modified by stopyoukid
#
html="<html><head><meta charset=\"utf-8\"><title>Pretty Diff</title><style>body {text-align: center;}#wrapper {display: inline-block;margin-top: 1em;min-width: 800px;text-align: left;}h2 {background: #fafafa;background: -moz-linear-gradient(#fafafa, #eaeaea);background: -webkit-linear-gradient(#fafafa, #eaeaea);-ms-filter: \"progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')\";border: 1px solid #d8d8d8;border-bottom: 0;color: #555;font: 14px sans-serif;overflow: hidden;padding: 10px 6px;text-shadow: 0 1px 0 white;margin: 0;}.file-diff {border: 1px solid #d8d8d8;margin-bottom: 1em;overflow: auto;padding: 0.5em 0;}.file-diff > div {width: 100%:}pre {margin: 0;font-family: \"Bitstream Vera Sans Mono\", Courier, monospace;font-size: 12px;line-height: 1.4em;text-indent: 0.5em;}.file {color:
@soulshake
soulshake / .vimrc
Created June 8, 2015 01:33
toggle paste mode automatically in vim
" never do this again --> :set paste <ctrl-v> :set no paste
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste

Keybase proof

I hereby claim:

  • I am soulshake on github.
  • I am soulshake (https://keybase.io/soulshake) on keybase.
  • I have a public key whose fingerprint is 8133 FB0B AA50 B718 3CF3 CA0C 6595 5E60 9B07 6014

To claim this, I am signing this object:

@soulshake
soulshake / tld-costs.py
Last active July 28, 2020 12:39
A script to list registration prices of all Gandi TLDs at E rates
#!/usr/bin/env python
"""
Author: AJ Bowen
Created: 2014-10-09
A script to list registration prices of all Gandi TLDs at E rates
Prices correspond to a one-year registration except where a TLD requires a minimum registration
of more than one year.
Output is CSV format containing three fields:

Base 27 encoding

This is just for lulz.

  • Take a character string (ASCII8, no character >242).
  • Transform each byte into a sequence of 5 trinary digits (i.e. from 00000 to 22222).
  • Concatenate all trinary digits (i.e. a long sequence of 0, 1, and 2).
  • Add extra 0s at the end so that the total length is divisible by 3.
  • Break down by groups of 3.
  • Transform each group of 3 into an integer, ranging from 0 to 26.