Skip to content

Instantly share code, notes, and snippets.


Chris Roerig chris-roerig

View GitHub Profile
chris-roerig /
Created Sep 4, 2020
Script to download and install deb packge of Minecraft
# This script will pull the latest Minecraft.deb file from Mojang and install it.
# I put this on a cron to run every week. I created this because I was tired of having
# to update the launcher every time I opened it.
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
chris-roerig / gist:5b6418a30749021714eb017420b2fc43
Last active May 15, 2020
rsync backup with 6 day rotation
View gist:5b6418a30749021714eb017420b2fc43
# copied from
# minor modifications made to support --exclude-from file
# This maintains a one week rotating backup. This will normalize permissions on
# all files and directories on backups. It has happened that someone removed
# owner write permissions on some files, thus breaking the backup process. This
# prevents that from happening. All this permission changing it tedious, but it
# eliminates any doubts. I could have done this with "chmod -R +X", but I
chris-roerig / readme.txt
Last active Feb 17, 2021
how to install bootstrap 4 in Rails 6 via webpacker
View readme.txt
# thanks Recker Swartz -
Rails 6 with Bootstrap and configured with Webpack
Step 1:
yarn add bootstrap jquery popper.js
Step 2:
in config/webpack/environment.js add the following:
chris-roerig /
Last active Jun 9, 2019
Description level Ruby 2.6.0 documentation


Simple Access Control Lists.

Access control lists are composed of “allow” and “deny” halves to control access.  Use “all” or “*” to match any address.  To match a specific address use any address or address mask that IPAddr can understand.

chris-roerig / rdm.rb
Created Nov 8, 2018
Ruby drum machine
View rdm.rb
ruby -e "tempo=(60_000/(ARGV[0].to_i||100));start=0;current=(*1000).to_i;while true do current=(*1000).to_i;if((current-start)>tempo);start=current;print\"\a\";end;end" 120
chris-roerig / recipe.rb
Last active Oct 18, 2018
Automate vimrc and VundleInstall with Chef
View recipe.rb
remote_file "/home/chris/.vimrc" do
source ""
owner "chris"
group "chris"
mode "0755"
directory "/home/chris/.vim/bundle/" do
owner "chris"
group "chris"
chris-roerig / rails_helper.rb
Created Mar 8, 2018
DatabaseCleaner rails_helper config
View rails_helper.rb
RSpec.configure do |config|
config.use_transactional_fixtures = false
# Use transactions by default
config.before :each do
DatabaseCleaner.strategy = :transaction
# For the javascript-enabled tests, switch to truncation, but *only on tables that were used*
config.before :each, :js => true do
chris-roerig / mathtools.R
Last active Jul 18, 2017
Simple R6 class in R
View mathtools.R
MathTool <-
public = list(
data = NULL,
initialize = function(data = c()){
self$data <- data
odds = function() {
chris-roerig / initializer_paperclip.rb
Last active Jun 27, 2017
Rails 4 S3 Paperclip initializer
View initializer_paperclip.rb
# Gemfile
# gem "aws-sdk"
# gem 'paperclip', :git=> '', :ref => '523bd46c768226893f23889079a7aa9c73b57d68'
# config/initializers/paperclip.rb
storage: :s3,
s3_protocol: 'https',