Skip to content

Instantly share code, notes, and snippets.

View keiththomps's full-sized avatar

Keith Thompson keiththomps

View GitHub Profile
@keiththomps
keiththomps / README.md
Created January 10, 2020 15:19
Code from Introduction to Python Development lectures translated to Ruby

To test this out, download all of these files into the same directory and run the following command from within that directory on the command line:

$ ruby using_classes.rb
4-cylinder
front-driver
front-passenger
rear-driver
rear-passenger
A care with an 4-cylinder engine, and front-driver, front-passenger, rear-driver, rear-passenger tires
@keiththomps
keiththomps / post_example.go
Created March 4, 2019 18:59
An example of how to make a POST request using Go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
# Download the latest Ghost Image
resource "docker_image" "image_id" {
name = "${var.image}"
}
# Start the Container
resource "docker_container" "container_id" {
name = "${var.container_name}"
image = "${docker_image.image_id.latest}"
ports {
@keiththomps
keiththomps / keybase.md
Created June 28, 2018 20:17
keybase.md

Keybase proof

I hereby claim:

  • I am keiththomps on github.
  • I am keiththomps (https://keybase.io/keiththomps) on keybase.
  • I have a public key ASBRytaeLef0vL4omBTJZ0JbcdpcOyQMb_6OD00bu9laEAo

To claim this, I am signing this object:

@keiththomps
keiththomps / .vimrc
Created October 31, 2017 14:04
Stripped down vim config
set nocompatible
filetype off
filetype plugin indent on
set ttyfast
set laststatus=2
set encoding=utf-8 " Set default encoding to UTF-8
set autoread " Automatically reread changed files without asking me anything
@keiththomps
keiththomps / .vimrc
Created October 31, 2017 14:04
Stripped down vim config
set nocompatible
filetype off
filetype plugin indent on
set ttyfast
set laststatus=2
set encoding=utf-8 " Set default encoding to UTF-8
set autoread " Automatically reread changed files without asking me anything
@keiththomps
keiththomps / signal_spec.rb
Created May 5, 2017 14:59
Example signal handling test
require "spec_helper"
class MyClass
def self.run(command)
Signal.trap("TERM") { trap_term }
`#{command}`
end
def self.trap_term
@keiththomps
keiththomps / init.vim
Created April 27, 2017 22:19
CoderJourney neovim config
call plug#begin('~/.config/nvim/plugged')
function! DoRemote(arg)
UpdateRemotePlugins
endfunction
Plug 'Shougo/deoplete.nvim', { 'do': function('DoRemote'), 'tag': '*' }
let g:deoplete#enable_at_startup = 1
Plug 'AndrewRadev/splitjoin.vim'
@keiththomps
keiththomps / Dockerfile
Created February 26, 2017 11:41
These modifications will allow you to restart a container that is using puma as the app server. Create a `script` directory (`mkdir script`), and add the `start` script to it. `start` will need to be made executable (`chmod +x script/start`). The only line in the Dockerfile that should change is the `CMD` line. Rebuild the `app` image.
FROM ruby:2.3.1
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
postgresql-client \
nodejs \
&& apt-get -q clean \
&& rm -rf /var/lib/apt/lists
# Pre-install gems with native extensions