Skip to content

Instantly share code, notes, and snippets.

@floehopper
floehopper / zx81-print-hi.bas
Created Nov 22, 2020
ZX81 machine code program to print "HI"
View zx81-print-hi.bas
10 REM 000000000000
20 POKE 16514, 1
30 POKE 16515, 141
40 POKE 16516, 64
50 POKE 16517, 17
60 POKE 16518, 2
70 POKE 16519, 0
80 POKE 16520, 205
90 POKE 16521, 107
100 POKE 16522, 11
@floehopper
floehopper / ec2-iam-security-credentials.md
Last active Nov 7, 2020
Obtaining security credentials derived from IAM role on EC2 machine
View ec2-iam-security-credentials.md
@floehopper
floehopper / install.md
Last active Aug 31, 2020
Installing OSX Catalina from scratch
View install.md

List & install software updates

softwareupdate --list
sudo softwareupdate --verbose --install --all

Set computer name

COMPUTER_NAME="<computer-name>"
sudo scutil --set ComputerName $COMPUTER_NAME
@floehopper
floehopper / Vagrantfile
Last active Aug 9, 2019
Ubuntu Xenial with Ruby installed via rbenv
View Vagrantfile
PROVISION_SYSTEM = <<~EOS
set -e
apt-get update --yes
apt-get install --yes gcc
apt-get install --yes make
EOS
PROVISION_USER = <<~EOS
set -e
mkdir -p ~/.rbenv
@floehopper
floehopper / testing_before_filter_in_controller_spec.rb
Created Jul 4, 2019
Testing before_filter in controller spec
View testing_before_filter_in_controller_spec.rb
require 'rails_helper'
RSpec.describe MyController do
describe 'GET #any_action' do
controller do
def any_action
head :ok
end
end
@floehopper
floehopper / update-git-author-date-and-commiter-date-to-current-time.sh
Last active Feb 17, 2020
Update git author-date and committer-date to current time with 1 second delay between commits
View update-git-author-date-and-commiter-date-to-current-time.sh
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$(date)"; export GIT_AUTHOR_DATE="$(date)"; sleep 1' master..HEAD
@floehopper
floehopper / Gemfile
Last active Nov 10, 2018
Mocha issue 349
View Gemfile
source 'https://rubygems.org'
gem 'minitest'
gem 'mocha'
@floehopper
floehopper / docker-build-output.txt
Created Oct 24, 2018
Build and run docker image for Ruby v2.5.3 on Ubuntu 14.04
View docker-build-output.txt
aws-codebuild-docker-images/ubuntu/ruby/2.5.3 $ docker build -t aws/codebuild/ruby:2.5.3 .
Sending build context to Docker daemon 10.24kB
Step 1/13 : FROM ubuntu:14.04.5
---> 132b7427a3b4
Step 2/13 : ENV DOCKER_BUCKET="download.docker.com" DOCKER_VERSION="17.09.0-ce" DOCKER_CHANNEL="stable" DOCKER_SHA256="a9e90a73c3cdfbf238f148e1ec0eaff5eb181f92f35bdd938fd7dab18e1c4647" DIND_COMMIT="3b5fac462d21ca164b3778647420016315289034" DOCKER_COMPOSE_VERSION="1.21.2" GITVERSION_VERSION="3.6.5"
---> Using cache
---> b8af7e6d7dc8
Step 3/13 : RUN set -ex && echo 'Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/99use-gzip-compression && apt-get update && apt install -y apt-transport-https && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | tee /etc/apt/sources.list.d/mono-official-stable.list && apt-get update && apt-
@floehopper
floehopper / install.sh
Created Aug 8, 2018
Installing (and building native extensions for) RedCloth gem on Ruby v1.8.7
View install.sh
bundle config --local build.RedCloth --with-cflags="-w"
bundle install
You can’t perform that action at this time.