Skip to content

Instantly share code, notes, and snippets.


Kevin Brown chevinbrown

View GitHub Profile
chevinbrown / layout.leex
Last active Jul 31, 2020
Quick toast messages from flash with LiveView
View layout.leex
<%= if assigns[:flash] && !assigns[:skip_flash] do %>
<%= render_flash(@flash) %>
<% end %>
View push_secrets.rb
#!/usr/bin/env ruby --disable-gems
require "json"
file ="#{__dir__}/../.env")
"sections": [
"name": "",
chevinbrown /
Created Aug 16, 2019 — forked from troyfontaine/
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or

chevinbrown / Gemfile
Created Mar 13, 2018 — forked from nateberkopec/Gemfile
Closure compiler for a Rails 3 app
View Gemfile
group :assets do
gem 'closure-compiler'
View .aliases
alias be="bundle exec"
alias cl="clear"
alias ga="git add"
alias gc="git commit"
alias gca="git commit -am"
alias gch="git checkout"
alias gcl="git clone"
alias gi="git init"
alias gl="git log"
alias gs="git status"
chevinbrown / postgresql.conf
Created Apr 18, 2017
Local postgres changes for a speedy experience
View postgresql.conf
#fsync = on # turns forced synchronization on or off
fsync = off
#synchronous_commit = on # synchronization level;
synchronous_commit = off
chevinbrown / gulpfile.js
Created Apr 18, 2017 — forked from torgeir/gulpfile.js
Example gulpfile.js
View gulpfile.js
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
chevinbrown / Flatty.rb
Created Aug 2, 2016
Flatten Array of Integers
View Flatty.rb
class Array
# Flattens only an array of integers with varying dimensions
def flatty!'[]','').split(',').map(&:to_i)
def flatty_test
a1 = [[1, 2, [3]], 4]
a2 = [1, [2, 3, 4], [[[5, [6]]]]]
chevinbrown / .gitconfig
Created Jan 28, 2016 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
View .gitconfig
name = Pavan Kumar Sunkara
email =
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
smtpencryption = tls
smtpserver =