Skip to content

Instantly share code, notes, and snippets.


Tim Morgan seven1m

View GitHub Profile
seven1m / lots_of_symbols.rb
Last active Dec 21, 2021
Adaptation of the first 10,000 words from, as a list of Ruby symbols
View lots_of_symbols.rb
seven1m /
Last active Nov 8, 2021
Script to get latency for 3 AWS US regions
# usage: ./ | sort -n 2.7
# 39.93 us-east-2
# 44.95 us-east-1
# 64.89 us-west-2
function region_latency() {
local region="$1"
ping -c 1 ec2.$ &>/dev/null # throw away the first ping because DNS
seven1m / hello_world_llvm.cpp
Last active Apr 23, 2022
Simple 'hello world' example in LLVM IRBuilder
View hello_world_llvm.cpp
// % clang++ $(llvm-config --cxxflags --ldflags --system-libs --libs core) -o hello_world_llvm hello_world_llvm.cpp
// % ./hello_world_llvm
// hello world
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/ExecutionEngine/GenericValue.h>
#include <llvm/IR/IRBuilder.h>
#include <stdio.h>
using namespace llvm;
seven1m /
Last active Sep 4, 2021
A small Python script that creates a semi-transparent resizable frame that stays on top. I use it to mark an area of my screen (the area where my webcam is overlayed) off-limits when screencasting.
#!/usr/bin/env python
# shamelessly stolen and adapted from
# usage: python3 [width] [height] [x] [y] [opacity]
import cairo
import gi
import sys
import resource
package manager sync db install upgrade uninstall
apt-get update install install remove
brew update install upgrade uninstall
bundle N/A install update remove
gem N/A install install uninstall
pacman -y -S -S -R
seven1m / download_albums_from_flickr.rb
Created Sep 3, 2020
Ruby script to download albums from Flickr
View download_albums_from_flickr.rb
# downloads photos from your Flickr albums; each album is its own folder
# usage:
# gem install flickr
# FLICKR_API_KEY=abc123def456 FLICKR_SHARED_SECRET=abc123 FLICKR_USER_ID=11111111@N00 ruby download.rb
require 'flickr'
require 'fileutils'
require 'open-uri'
seven1m / fzf_branch_selection.zsh
Created Aug 6, 2020
Alias I use for switching branches
View fzf_branch_selection.zsh
# fuzzy finder branch selection
# if run by itself, switches to the selected branch
# if run in a subshell, echos the selected branch
function fgb() {
if [[ "$ZSH_SUBSHELL" == "0" ]]; then
git checkout $(fgb)
gbranches |
fzf --height 40% --ansi |
awk '{print $1}' |
View .fetchmailrc
poll protocol POP3
user "tim" with password "blablablabla" is tim here
seven1m /
Created May 28, 2019
fix mysql2 gem install on macos
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
seven1m /
Last active Apr 29, 2019
things I learned using OpenBSD on a laptop for the first time


How to disable console window on X11 start up

Comment out the xconsole line in /etc/X11/xenodm/Xsetup_0.

How to install intel wireless drivers

As root: