Skip to content

Instantly share code, notes, and snippets.

View mrysav's full-sized avatar

Mitchell Rysavy mrysav

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mrysav on github.
  • I am mrysav (https://keybase.io/mrysav) on keybase.
  • I have a public key whose fingerprint is ED40 9793 943A 6989 8477 0E1E 03E0 C4AD F0B9 2EDD

To claim this, I am signing this object:

@mrysav
mrysav / restic-backup.sh
Created February 11, 2020 14:27
Restic Backup Script
#!/bin/bash
# not needed if using packaged version
restic self-update
# Assumes you have RESTIC_REPOSITORY and RESTIC_PASSWORD_COMMAND set
# Refresh credentials here, if applicable
# Bail if restic is already running, maybe previous run didn't finish
@mrysav
mrysav / init_sys_v1.sh
Created June 13, 2019 14:37
init_sys_v1.sh
#!/usr/bin/env bash
# Colors
GRN='\033[1;32m'
NC='\033[0m'
echo -e "${GRN}Installing prerequisites...${NC}"
echo "rbenv: https://github.com/rbenv/ruby-build/wiki#suggested-build-environment"
@mrysav
mrysav / speak.rb
Last active March 2, 2019 05:59
Generating Markov sentences from character dialog
# frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'markovite'
# from_book: the filename (ending in .txt) of the Freddy book to read in
# character: the character's name to find dialog for (ie. Charles or Freddy)
def get_dialog(from_book, character)
# read the entire contents of the given file (book) into memory
@mrysav
mrysav / practice.js
Created May 1, 2018 20:44
Practice with random numbers
'use strict';
// This practice exercise will cover:
// - For loops: For loops are useful when you know you want to run through a bit of code a fixed number of times.
// There are three parts to declare: the variable, the conditional, and the incrementer.
// They look like this:
// for (let i = 0; i < 5; i = i + 1) {
// ...your code here...
// }
//
@mrysav
mrysav / openrct2-macos-quick.md
Last active December 29, 2017 00:28
OpenRCT2 macOS Quick Installation Guide

Who is this guide for?

This guide is for people who have a Mac and just want a quick way to get the game files for OpenRCT2 and play the game.

If you compiled the game yourself, have Linux, or you know your way around a terminal and just want to know what to do, take a look at the Installation on Linux and macOS guide.

Downloading OpenRCT2

  1. Download OpenRCT2 from the main Downloads page.
  2. Unzip the downloaded file and drag OpenRCT2.app to your Applications folder.
@mrysav
mrysav / appmanifest_285310.acf
Last active December 19, 2017 01:53
RCT1+2 App Manifest for Steam
"AppState"
{
"AppID" "285310"
"Universe" "1"
"installdir" "RCT1"
"StateFlags" "1026"
}
<!DOCTYPE html>
<html>
<!-- For this assignment, you will creating the shell of a quiz.
It should include:
1. A title (probably as a header tag)
2. A description of the quiz under the header
3. At least 3 questions.
Each question should have the question text and four options as answers.
@mrysav
mrysav / money.js
Created March 23, 2017 13:55
JavaScript Practice
var foodTotal = 236.0
var numberOfFoodPurchases = 20
var billsTotal = 156.0
var numberOfBills = 3
var funTotal = 56.0
var numberOfFunPurchases = 5
// This function calculates the average transaction amount for a category,
// given the total amount spent in that category and the number of transactions
// in that category
@mrysav
mrysav / benchmark-ec2-boottime.sh
Last active May 20, 2019 21:43 — forked from andsens/benchmark-ec2-boottime.sh
Starts a single instance and measures the time until SSH connectivity
#!/bin/bash -e
# Make sure awscli is configured correctly ("aws configure")
ami_id='ami-60b6c60a' # amazon linux
availability_zone='us-east-1b'
keypair="KEYPAIR_NAME"
keypath="PATH_TO_PEM_FILE"
instance_type="t2.micro"
sg_id="sg-YOURS"
subnet_id="subnet-YOURS"