Skip to content

Instantly share code, notes, and snippets.


Lucas Caton lucascaton

View GitHub Profile
GlenCrawford / schema_dumper.rb
Created Apr 17, 2020
Patching Rails database schema dumps to support multiple PostgreSQL schemas.
View schema_dumper.rb
# Overrides Rails file activerecord/lib/active_record/schema_dumper.rb to
# include all schema information in the db/schema.rb file, for example, in the
# create_table statements. This allows for a working development database
# to be built from a schema.rb file generated by rake db:schema:dump.
# This is essentially a rebuild of the "schema_plus_multischema" gem (which is
# unfortunately only compatible with Rails ~> 4.2).
# Tested with Rails 6.0.
3zcurdia / haml2erb.rb
Last active Sep 22, 2020
Haml to erb converter with herbalizer
View haml2erb.rb
#!/usr/bin/env ruby
require "httparty"
class Converter
def initialize(filename)
@content =
attr_reader :content
View Letsencrypt acmev2
sudo ./certbot-auto certonly --manual -d '' -d '*' --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns-01 --server
wwerner /
Last active Apr 29, 2021
Parse Heroku DB URL into Spring Boot Datasource Environment Variables
# Two possibilities to parse a Postgres DB URL from heroku into environment variables
# that Spring Boot understands.
# You would need that, if you do not build on heroku but push docker images
# from another source
# Does not need bash. Works on alpine linux / busybox. Tested with openjdk:8-jdk-alpine base image.
export DATABASE_URL=postgres://user:password@host:port/database
# Naive way, would break with [@:/] in username or password.
DB_TYPE=$(echo $DATABASE_URL | awk -F'[:@/]' '{print $1}')"ql"
brianshumate /
Last active Jan 25, 2022
The Simplest Terraform with Docker on macOS

If you'd like to experiment with Terraform on macOS locally, a great provider for doing so is the Docker provider. You can get set up in a few simple steps, like so:

1. Install Docker

Install Docker for Mac if you have not already.

duderamos / unicorn.service
Last active Jan 1, 2017
Unit file for unicorn
View unicorn.service
Description=Unicorn Server
Wants=mysqld.service postgresql.service
After=redis.service mysqld.service postgresql.service
johnpmorris /
Last active Nov 17, 2016
after multiple requests to share my themes for various slack channels. here they are.




View capybara-recording.rb
require 'RMagick'
require 'capybara'
require 'launchy'
module Capybara::Recording
def start_recording
system "rm -f tmp/*"
def save_recording
View github_labels_manager.rb
require 'octokit'
client = login: 'username', password: 'password'
repos = []
page = 1
loop do
puts "Fetching repositories from page ##{page}"
imjasonh / markdown.css
Last active Mar 11, 2022
Render Markdown as unrendered Markdown (see
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;