Skip to content

Instantly share code, notes, and snippets.

View theoretick's full-sized avatar

Lucas Charles theoretick

View GitHub Profile
module RQueue
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
#set the queue name some as the model name
@theoretick
theoretick / 01-activerecord.rb
Created December 9, 2016 22:25 — forked from janko/01-activerecord.rb
PostgreSQL JSON querying in Sequel (my presentation from our local Ruby meetup)
require "active_record"
ActiveRecord::Base.establish_connection('postgres:///testing')
ActiveRecord::Migration.verbose = false
ActiveRecord::Migration.class_eval do
create_table :played_quizzes, force: true do |t|
t.integer :player_ids, array: true
t.json :quiz_snapshot
end
@theoretick
theoretick / ffmpeg_cheatsheet.sh
Created December 18, 2016 02:49
osx macOS video conversion with ffmpeg
# ffmpeg cheatsheet for video resizing and modification
## Install ffmpeg (this takes forever
❯ brew install ffmpeg --with-libvpx
# ...
==> make install
🍺 /usr/local/Cellar/ffmpeg/3.2.2: 239 files, 51.7M, built in 8 minutes 31 seconds
## Downscale/upscale to desired dimensions
❯ ffmpeg -i input.mp4 -s 1080x720 output.mp4
@theoretick
theoretick / postmortem_template.md
Created March 21, 2017 15:04
Template for event outages and site post mortems

Post-mortem February 16th, 2017

What happened

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Incident timeline

At 13:09 UTC we started noticing high load...

@theoretick
theoretick / gist:2ba802f2ef521a2138f86afe2478e04d
Last active March 31, 2017 16:06
How to fix failures to start SoapUI on OSX macOS
//
// NSColorHelpers.swift
// MapPointMapper
//
// Created by Lucas Charles on 2/13/15.
// Copyright (c) 2015 dmiedema. All rights reserved.
//
import Foundation
import AppKit
@theoretick
theoretick / Dockerfile.alpine
Created November 12, 2017 01:42
ruby2.3.2, chrome headless, alpine Dockerfile
FROM ruby:2.4.2-alpine3.4
MAINTAINER Lucas Charles (theoretick) <[email protected]>
EXPOSE 8080
ENV APP_PATH /srv/app
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.4/main" >> /etc/apk/repositories && \
echo "http://dl-4.alpinelinux.org/alpine/v3.4/community" >> /etc/apk/repositories
#!/bin/sh
# forked from https://gist.github.com/Draiken/dbe1bd2af0d583c28d75
echo "Generating rails app"
rails new fabrication_test --quiet
cd fabrication_test
echo "gem 'fabrication'" >> Gemfile
echo "Installing fabrication"
bundle install > /dev/null
echo "Generating models and fabricators"
@theoretick
theoretick / dot_to_png.sh
Created February 1, 2018 15:55
Generating Entity Relationship Diagrams (ERD) with ruby Sequel and Graphiz
#! /usr/bin/env bash
#
# Usage: ./dot_to_png input.dot output.png
if [ ! -x $(command -v dot) ]
then
echo 1>&2 "dot missing in \$PATH"
echo 1>&2 "Couldn't find graphiz"
exit 2
fi

Lucas Charles README

My name is Lucas. My preferred pronouns are He/Him/They.

The purpose of this document is to help us work better together by aligning on what I value and how I work.

What I do

I am primarily an engineer but do (and often prefer) wearing many hats. I enjoy supporting others, both directly and indirectly.