Skip to content

Instantly share code, notes, and snippets.

Andrew Gilmartin andrewgilmartin

Block or report user

Report or block andrewgilmartin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andrewgilmartin
andrewgilmartin / updateTableOfTodos.js
Last active Oct 6, 2019
A Google App Script to build a Table of TODOs from TODOs distributed in a Google Doc document.
View updateTableOfTodos.js
/*
See https://www.calliopesounds.com/2019/10/adding-table-of-todos-to-google-document.html
This Google App Script script collects the text of all the TODO paragraphs
and organizes them under a Table of TODOs heading. The TODO paragraph is
normal-styled and starts with the string "TODO: ". The Table of TODOs is a
heading-styled paragraph and contains only the text "Table of TODOs". The
TODO texts are organized in to numbered list items under the heading. In
addition, the script adds a Bookmark to each TODO paragraph so that it can
be referenced from the numbered list item.
@andrewgilmartin
andrewgilmartin / gist:68d1451e43cbcce8487a684e35dc9b1b
Last active Sep 27, 2019
Missing steps from Terraform's "Basic Two-Tier AWS Architecture" README.txt
View gist:68d1451e43cbcce8487a684e35dc9b1b

Some missing steps from Terraform's "Basic Two-Tier AWS Architecture" README.txt

https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/two-tier

(1) If you have an AWS account that allows for "EC2 Classic" then this whole example might not work for you. I have an ancient AWS account that has EC2 Classic support and have found that other Hashicorp examples do not work. (The networking and security group defaults seem to be wrong.) You call tell if you have an EC2 Classic account as to will see "EC2" inaddition to "VPC" listed under the "Supported Platforms" of the "EC2 Dashboard." I advise you to create a new account and use that instead; I did.

(2) Generate an SSH key pair on your local machine, eg

ssh-keygen -f id_terraform_two_tier
View days_remaining.pl
#!/usr/bin/perl -w
use strict;
use Date::Calc qw/Today Delta_Days/;
my @today = Today();
my @events = ();
while ( <DATA> ) {
next if /^#/;
View twenty_lessons.markdown

From Tim Snyder, Professor of History at a Yale. Posted privately to FB.

"Americans are no wiser than the Europeans who saw democracy yield to fascism, Nazism, or communism. Our one advantage is that we might learn from their experience. Now is a good time to do so. Here are twenty lessons from the twentieth century, adapted to the circumstances of today.

  1. Do not obey in advance. Much of the power of authoritarianism is freely given. In times like these, individuals think ahead about what a more repressive government will want, and then start to do it without being asked. You've already done this, haven't you? Stop. Anticipatory obedience teaches authorities what is possible and accelerates unfreedom.

  2. Defend an institution. Follow the courts or the media, or a court or a newspaper. Do not speak of "our institutions" unless you are making them yours by acting on their behalf. Institutions don't protect themselves. They go down like dominoes unless each is defended from the beginning.

  3. Recall profess

View build-events-table.html
<div id="85C18603-69F2-4331-AD8C-2CA0D7139DCA"></div>
<script>
(function (id) {
var e = [
{ date: '2016-05-4', times: '6-9 PM', location: "Kingston Library", url: "http://www.greatswamp.info/2016/04/game-nights-wednesday-thursday-may-4-5.html" },
{ date: '2016-05-5', times: '6-9 PM', location: "Kingston Library", url: "http://www.greatswamp.info/2016/04/game-nights-wednesday-thursday-may-4-5.html" }
];
var w = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ];
View 2d6.pl
#!/usr/bin/perl
print "<table>";
print "<tr>";
print "<th></th>";
for ( $u = 1; $u < 7; $u +=1 ) {
print "<th>$u</th>";
}
print "</tr>";
View osx-duplex-split.sh
#!/bin/bash
function split() {
file="$1"
dir="$2"
odd="$3"
even="$4"
pages=$(/usr/local/bin/pdfinfo "$file" | perl -ne 'print "$1" if /^Pages:\s+(\d+)/')
/usr/local/bin/pdfseparate "$file" "$dir/p-%d.pdf"
View Spaceship volumes
#!/usr/bin/perl -w
use strict;
my $length_proportion = 5;
my $width_proportion = 2;
my $height_proportion = 1;
for my $volume ( ( 500, 120, 100, 85, 75, 60, 50, 40, 25, 10 ) ) {
my $n = ( $volume / $length_proportion / $width_proportion / $height_proportion ) ** (1/3);
View gist:444fda64e66577bbb78c

#The Uses of Poverty: The Poor Pay All.

Herbert J. Gans.

Social Policy July/August 1971: pp. 20-24.

Some twenty years ago Robert K. Merton applied the notion of functional analysis to explain the continuing though maligned existence of the urban political machine: if it continued to exist, perhaps it fulfilled latent - unintended or unrecognized - positive functions. Clearly it did. Merton pointed out how the political machine provided central authority to get things done when a decentralized local government could not act, humanized the services of the impersonal bureaucracy for fearful citizens, offered concrete help (rather than abstract law or justice) to the poor, and otherwise performed services needed or demanded by many people but considered unconventional or even illegal by formal public agencies.

Today, poverty is more maligned than the political machine ever was; yet it, too, is a persistent social phenomenon. Consequently, there may be some merit in applying functional analysis to poverty, i

@andrewgilmartin
andrewgilmartin / gist:26fd5b2ce02a3219c96c
Last active Aug 29, 2015
Bookmarklet to cleanup Kindle Your Highlights page
View gist:26fd5b2ce02a3219c96c
javascript:(function(){
var O = $('<div class="books"/>');
var S;
var xs = $("#allHighlightedBooks").children();
for ( var i = 0; i < xs.length; i++ ) {
var x = $(xs[i]);
var c = x.attr("class");
if ( c.indexOf("bookMain") != -1 ) {
t = $('.title',x).text();
a = $('.author',x).text();
You can’t perform that action at this time.