Skip to content

Instantly share code, notes, and snippets.

@sethwebster
sethwebster / README.md
Last active Mar 14, 2021
Make Docker Cache Gem Installs to speed up Bundle Install
View README.md

Gem Install Dockerfile Hack

If you're hacking on your Gemfile and using Docker, you know the pain of having the bundle install command run after you've added or removed a gem. Using docker-compose you could mount a volume and stage your gems there, but this adds additional complexity and doesn't always really solve the problem.

Enter this imperfect solution:

What if we installed every gem into it's own Docker layer which would be happily cached for us?

gem-inject-docker does just that. It takes the list of gems used by your app via bundle list and transforms it into a list of RUN gem install <your gem> -v <gem version> statements and injects them into the Dockerfile at a point of your choosing.

@mrmartineau
mrmartineau / stimulus.md
Last active Apr 10, 2021
Stimulus cheatsheet
View stimulus.md
@ar-android
ar-android / default
Created Feb 9, 2017 — forked from dtomasi/default
Brew Nginx PHP7
View default
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@danharper
danharper / CatchAllOptionsRequestsProvider.php
Last active Feb 12, 2021
Lumen with CORS and OPTIONS requests
View CatchAllOptionsRequestsProvider.php
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@ruph
ruph / .vimrc
Last active Apr 13, 2021
vim settings
View .vimrc
" Use vim settings, rather then vi settings (much better!)
" This must be first, because it changes other options as a side effect.
set nocompatible
set t_Co=256 " iTerm2 supports 256 color mode.
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
filetype plugin on " use the file type plugins