Skip to content

Instantly share code, notes, and snippets.

View grantcooksey's full-sized avatar
🌴
On vacation

Grant Cooksey grantcooksey

🌴
On vacation
View GitHub Profile
@grantcooksey
grantcooksey / emacs.md
Last active June 8, 2018 03:03
Collection of emacs shortcuts

Navigation

  • Move to beginning of line: M-m
  • End of file: M->
  • Beginning of file: M-<
  • Close current window C-x 0

Shell

  • run last command: M-p
  • run previous command: M-n
@grantcooksey
grantcooksey / start_local_env.sh
Last active May 14, 2018 15:34
Start up docker containers when opening shell
#! /bin/bash
# Got tired of manually starting up docker containers when rebooting my computer
# so I made this to spin them up when I open my shell. Tuck this into your *_profile file
containers=('$container_id')
for container in ${containers[@]}; do
container_active=$(docker inspect -f '{{.State.Running}}' $container)
if [ "$container_active" != "true" ]; then
docker start $container
@grantcooksey
grantcooksey / stubber.py
Last active February 8, 2023 11:21
Mocking an S3 bucket using Stubber
import io
import json
import botocore.session
from botocore.stub import Stubber
from botocore.response import StreamingBody
expected_message = {
'message': 'readme'
}