Instantly share code, notes, and snippets.

View open_source_church_software.md
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
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
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
#
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')
View parallel.rb
#!/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):
#
View boardslam.rb
#!/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
View etc_krb5.conf
[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
View init.vim
" minimal neovim config
"
" 1. save this file to ~/.config/nvim/init.vim
" 2. cd ~/.config/nvim && curl -o autoload/pathogen.vim https://tpo.pe/pathogen.vim
" 3. clone (or add as submodules) these plugins to the bundle directory:
" https://github.com/ctrlpvim/ctrlp.vim.git
" https://github.com/editorconfig/editorconfig-vim.git
" https://github.com/mxw/vim-jsx.git
" https://github.com/neomake/neomake.git
" https://github.com/pangloss/vim-javascript.git