Skip to content

Instantly share code, notes, and snippets.

👨‍💻
Why is my code so hard to understand? # no comment

Tim Morgan seven1m

👨‍💻
Why is my code so hard to understand? # no comment
Block or report user

Report or block seven1m

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
@seven1m
seven1m / fix.sh
Created May 28, 2019
fix mysql2 gem install on macos
View fix.sh
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
@seven1m
seven1m / openbsd.md
Last active Apr 29, 2019
things I learned using OpenBSD on a laptop for the first time
View openbsd.md

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 Mar 15, 2019
simple clipboard history script for Sway window manager and dmenu (might work with other Wayland window managers too)
View clipd
#!/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 Jan 12, 2019
Sinatra app boilerplate so I don't have to go hunting for these settings every time.
View Gemfile
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
@seven1m
seven1m / open_source_church_software.md
Last active Aug 5, 2019
List of Open Source Church Software
View open_source_church_software.md
@seven1m
seven1m / observer-rust.rb
Created Jul 17, 2018
Observr script for comiling a Rust project and running tests when files are saved.
View observer-rust.rb
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 Jun 15, 2018
I was interested to see static binary size difference between Crystal and Rust.
View crystal_static_binary_filesize_vs_rust.sh
~/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
@seven1m
seven1m / dymo_speed.rb
Last active Mar 30, 2018
Speed up printing to Dymo printers on macOS High Sierra by killing hung processes.
View dymo_speed.rb
# Problem:
#
# There is a 10-12 second delay between each print job when printing labels on a Dymo LabelWriter
# (and probably other Dymo printers) via newer versions of Cups. This affects macOS High Sierra,
# Raspbian Linux, and probably other Linux distributions.
#
# This script is a hack to work around the problem by killing hung print processes once the label is finished printing.
#
# Script Usage:
#
View people_list_to_csv.rb
# export a list from Planning Center People to CSV
#
# setup:
# 1. gem install pco_api
# 2. create a personal access token at https://api.planningcenteronline.com/oauth/applications
# 3. edit the app id and secret below
#
# usage:
# ruby people_list_to_csv.rb listid filename.csv
#
@seven1m
seven1m / archive.rb
Last active Dec 5, 2017
download all images for twitter archive
View archive.rb
# gem install http
# unzip archive.zip -d archive
# cd archive
# ruby archive.rb
require 'http'
require 'fileutils'
require 'digest'
FileUtils.mkdir_p('media')
You can’t perform that action at this time.