Skip to content

Instantly share code, notes, and snippets.

View seven1m's full-sized avatar

Tim Morgan seven1m

View GitHub Profile
@seven1m
seven1m / download_albums_from_flickr.rb
Created September 3, 2020 02:26
Ruby script to download albums from Flickr
# 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
seven1m / fzf_branch_selection.zsh
Created August 6, 2020 15:59
Alias I use for switching branches
# 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)
else
gbranches |
fzf --height 40% --ansi |
awk '{print $1}' |
poll mail.morgn.net protocol POP3
user "tim" with password "blablablabla" is tim here
@seven1m
seven1m / fix.sh
Created May 28, 2019 16:30
fix mysql2 gem install on macos
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
@seven1m
seven1m / openbsd.md
Last active April 29, 2019 13:48
things I learned using OpenBSD on a laptop for the first time

OpenBSD

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:

@seven1m
seven1m / clipd
Last active March 24, 2020 14:42
simple clipboard history script for Sway window manager and dmenu (might work with other Wayland window managers too)
#!/usr/bin/env ruby
# https://mpov.timmorgan.org/clipboard-history-in-sway-window-manager/
require 'json'
STORE = "#{ENV['HOME']}/.clipboard-history"
LIMIT = 100
unless File.exist?(STORE)
@seven1m
seven1m / Gemfile
Last active January 12, 2019 16:43
Sinatra app boilerplate so I don't have to go hunting for these settings every time.
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
@seven1m
seven1m / open_source_church_software.md
Last active March 4, 2024 22:19
List of Open Source Church Software
@seven1m
seven1m / observer-rust.rb
Created July 17, 2018 01:31
Observr script for comiling a Rust project and running tests when files are saved.
require 'open3'
def test
puts
puts '========================================='
puts
_, stdout, wait_thr = Open3.popen2('cargo test -- --nocapture --test-threads=1')
print stdout.getc until stdout.eof?
wait_thr.value.success?
end
@seven1m
seven1m / crystal_static_binary_filesize_vs_rust.sh
Last active June 15, 2018 16:48
I was interested to see static binary size difference between Crystal and Rust.
~/Desktop cat hello_crystal.cr
puts "hello world"
~/Desktop cat hello_rust.rs
fn main() {
println!("hello world");
}
~/Desktop crystal --version
Crystal 0.25.0 [7fb783f7a] (2018-06-11)
LLVM: 4.0.0