Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢

Kevin Brown chevinbrown

🐢
View GitHub Profile
@chevinbrown
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 = File.read("#{__dir__}/../.env")
JSON.generate(
{
"sections": [
{
"title": "ENVIRONMENT VARIABLES",
"name": "",
@chevinbrown
chevinbrown / 1-setup.md
Created Aug 16, 2019 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra
View 1-setup.md

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 Mar 13, 2018 — forked from nateberkopec/Gemfile
Closure compiler for a Rails 3 app
View Gemfile
group :assets do
gem 'closure-compiler'
end
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
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
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
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!
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 Jan 28, 2016 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
View .gitconfig
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com