Skip to content

Instantly share code, notes, and snippets.

View chevinbrown's full-sized avatar
🦦

Kevin Brown chevinbrown

🦦
  • Charlotte, NC
View GitHub Profile
@chevinbrown
chevinbrown / layout.leex
Last active January 28, 2024 08:24
Quick toast messages from flash with LiveView
<%= if assigns[:flash] && !assigns[:skip_flash] do %>
<%= render_flash(@flash) %>
<% end %>
...
#!/usr/bin/env ruby --disable-gems
require "json"
file = File.read("#{__dir__}/../.env")
JSON.generate(
{
"sections": [
{
"title": "ENVIRONMENT VARIABLES",
"name": "",
@chevinbrown
chevinbrown / 1-setup.md
Created August 16, 2019 15:45 — forked from troyfontaine/1-setup.md
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 krypt.co

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 Krypt.co.

@chevinbrown
chevinbrown / Gemfile
Created March 13, 2018 22:54 — forked from nateberkopec/Gemfile
Closure compiler for a Rails 3 app
group :assets do
gem 'closure-compiler'
end
.tool-versions
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
chevinbrown / postgresql.conf
Created April 18, 2017 15:12
Local postgres changes for a speedy experience
#fsync = on # turns forced synchronization on or off
fsync = off
#synchronous_commit = on # synchronization level;
synchronous_commit = off
@chevinbrown
chevinbrown / gulpfile.js
Created April 18, 2017 02:37 — forked from torgeir/gulpfile.js
Example 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
chevinbrown / Flatty.rb
Created August 2, 2016 20:32
Flatten Array of Integers
class Array
# Flattens only an array of integers with varying dimensions
def flatty!
self.to_s.tr('[]','').split(',').map(&:to_i)
end
def flatty_test
a1 = [[1, 2, [3]], 4]
a2 = [1, [2, 3, 4], [[[5, [6]]]]]
@chevinbrown
chevinbrown / .gitconfig
Created January 28, 2016 17:12 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com