Skip to content

Instantly share code, notes, and snippets.

View seven1m's full-sized avatar

Tim Morgan seven1m

View GitHub Profile
@seven1m
seven1m / dymo_speed.rb
Last active March 30, 2018 18:28
Speed up printing to Dymo printers on macOS High Sierra by killing hung processes.
# 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:
#
# 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 December 5, 2017 03:08
download all images for twitter archive
# gem install http
# unzip archive.zip -d archive
# cd archive
# ruby archive.rb
require 'http'
require 'fileutils'
require 'digest'
FileUtils.mkdir_p('media')
#!/usr/bin/env ruby
# Run several commands for different directories at the same time and multiplex their output with color-coded app labels.
#
# Usage:
#
# ruby parallel.rb "foo:$HOME/projects/foo:bundle exec rake db:migrate" "bar:$HOME/projects/bar:bundle exec rake db:migrate"
#
# The output will look something like this (but the prefix labels will have different colors):
#
@seven1m
seven1m / boardslam.rb
Last active May 27, 2018 12:35
Classical Conversations Board Slam math game in use at http://seven1m.sdf.org/experiments/boardslam.cgi
#!/usr/bin/env ruby
# pass 3 numbers as arguments:
#
# ./boardslam.rb 3 5 1
#
# 3 - 5^0 - 1 = 1
# 3 - 5^0 * 1 = 2
# 3 + 5^0 - 1 = 3
# 3 + 5^0 * 1 = 4
@seven1m
seven1m / etc_krb5.conf
Last active June 4, 2016 18:41
Samba member server config
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = CRCCMINISTRIES.COM
#ticket_lifetime = 24h
forwardable = yes
@seven1m
seven1m / init.vim
Last active March 17, 2023 21:58
my vim/neovim config in < 100 LOC
syntax on " enable syntax highlighting
set background=dark " we like it dark!
try | colorscheme gruvbox | catch | endtry " use this awesome theme if possible
highlight Pmenu ctermbg=black guibg=black | " fix popup color so it's easier to read
filetype plugin on " load plugins based on file type
filetype indent on " load indent settings based on file type
set shiftwidth=2 " number of spaces to use for indenting
set softtabstop=2 " number of spaces to use when inserting a tab
set tabstop=2 " show tabs as 2 spaces
set expandtab " convert tabs into spaces
// ==UserScript==
// @name Trello Tweaks
// @namespace http://timmorgan.org
// @include https://trello.com/*
// @version 1
// @grant none
// ==/UserScript==
// press Q to show cards not assigned to anyone
@seven1m
seven1m / download_hex_docs.sh
Created November 15, 2015 02:37
Download the docs for a project from hexdocs.pm
#!/bin/bash
project=$1
wget --mirror -k -np http://hexdocs.pm/$project
ruby -e "puts ARGF.read.scan(/[A-Z]\\w*\\.[\\w\\.]+/).uniq.map { |l| 'http://hexdocs.pm/$project/' + l + '.html' }" hexdocs.pm/$project/dist/sidebar_items.js | wget --mirror -k -i -
wget --mirror -k http://hexdocs.pm/$project/extra-api-reference.html
@seven1m
seven1m / .watchr
Last active May 25, 2016 19:51
My .watchr script for use with the observr gem and rspec
# Put this file in the root of your Rails project and ignore it with git:
#
# echo ".watchr" >> .git/info/exclude
#
# Now run it in a tab with the observr gem:
#
# gem install observr
# observr .watchr
#
# Optionally, install the Fuubar gem to get a progress bar.