Skip to content

Instantly share code, notes, and snippets.

View mgaffney's full-sized avatar

Michael Gaffney mgaffney

View GitHub Profile
@sneakers-the-rat
sneakers-the-rat / clean_pdf.sh
Last active May 27, 2024 03:44
Strip PDF Metadata
# --------------------------------------------------------------------
# Recursively find pdfs from the directory given as the first argument,
# otherwise search the current directory.
# Use exiftool and qpdf (both must be installed and locatable on $PATH)
# to strip all top-level metadata from PDFs.
#
# Note - This only removes file-level metadata, not any metadata
# in embedded images, etc.
#
# Code is provided as-is, I take no responsibility for its use,
@jboursiquot
jboursiquot / README.MD
Last active December 5, 2018 13:57
Jump into Go @ Baltimore Go User Group Meetup

Jump into Go @ Baltimore Go User Group

In this exercise your task is to work with the newline-delimited string below and count the occurrence of each character per line. You will need to make use of several features of of the Go programming language to accomplish this task, including variables, values, for and range, slices, maps, functions and reading from a file.

Success Criteria

  • Read the list of Go proverbs from proverbs.txt and handle potential errors.
  • Iterate through every proverb and count the number of times the character appears in that sentence.
  • Make use of the standard library packages only.
  • Your output should look like the sample below (though the sequence of characters will be different).
@mgaffney
mgaffney / example.puml
Created February 16, 2018 17:00 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram. The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 1, 2024 22:47
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@mafredri
mafredri / brew-go-get.sh
Last active August 29, 2021 17:16
Homebrew managed go get
#!/bin/bash
# brew-go-get
# Original: https://blog.filippo.io/cleaning-up-my-gopath-with-homebrew/
set -euo pipefail
name_to_repo() {
local name="$1"
name="${name/go-get-}"
echo "${name//--//}"

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@apparentlymart
apparentlymart / NOTES.md
Last active July 26, 2016 16:57
AWS Describe/Get actions as Terraform Data Sources

AWS Describe and Get actions as Terraform Data Sources

Beyond the read-only resources that existed in Terraform before data resources were an official feature, I'd like to make room for a new pattern for re-usable modules where they accept only the minimum set of ids they need as variables and look up other data via data sources.

Here's a motivating example:

variable "aws_subnet_id" {
    description = "Id of the subnet where the EC2 instance will be created"
}
@zchee
zchee / actionlist.vim
Last active May 30, 2024 22:39
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@maxtruxa
maxtruxa / Antonyms.md
Last active May 9, 2024 20:14
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@einthusan
einthusan / go1.4arc65-ubuntu.sh
Last active July 10, 2018 23:43
Install Golang 1.4.1 on Ubuntu 14.04 AWS EC2
#!/bin/sh
# OPTIONAL FLAGS:
#
# -geoip true
# this will install maxmind geoip and auto update crontab file
#
# -cloudwatch true
# this will install aws cloud watch metrics and send them to aws dashboard
#