View dev-dnsmasq.sh
#!/bin/sh
brew install dnsmasq
echo "address=/dev/127.0.0.1" >> /usr/local/etc/dnsmasq.conf
sudo brew services start dnsmasq
sudo mkdir -p /etc/resolver
sudo tee /etc/resolver/dev >/dev/null <<EOF
nameserver 127.0.0.1
EOF
View fizzbuzz-fp-iterator.js
const fizzBuzz = {
[Symbol.iterator]: (() => {
const stop = 100
const iterate = function* (number = 1, count5 = 1, count7 = 1) {
if (number > stop) { return }
if (count5 == 5 && count7 == 7) {
yield ‘fizzbuzz’
yield *iterate(number + 1, 1, 1)
View .vimrc
" ripgrep
" https://github.com/BurntSushi/ripgrep
set grepprg=rg\ --vimgrep\ --no-heading
set grepformat^=%f:%l:%c:%m
command -nargs=+ -complete=file Rg silent! grep! <args> | copen | redraw!
nmap <silent> <leader>a :Rg "\b<C-R><C-W>\b"<CR>
" fzy - fuzzy find
" https://github.com/jhawthorn/fzy
function! FzyCommand(choice_command, vim_command)
View keybase.md

Keybase proof

I hereby claim:

  • I am coryf on github.
  • I am coryf (https://keybase.io/coryf) on keybase.
  • I have a public key whose fingerprint is 6C9E 35B5 473C 4A5C 02C5 FC71 02BA 3DF7 E946 03F8

To claim this, I am signing this object:

View .tmux.conf
# clone https://github.com/tmux-plugins/tmux-battery to <tmux-battery-path>
# add to .tmux.conf:
set -g status-right "#[fg=yellow]#(date +'%a %d') #[fg=green]#(date +'%I:%M%p')#[fg=white] #[bg=black] #{battery_percentage} #{battery_icon} "
set -g @batt_charged_icon "🔌"
set -g @batt_charging_icon "⚡"
set -g @batt_discharging_icon "🔋"
set -g @batt_attached_icon "⚠️"
View Dockerfile
# Starting from the official Elixir 1.3.2 image:
# https://hub.docker.com/_/elixir/
FROM elixir:1.3.2
# Based off of a Dockerfile by David Anguita <david@davidanguita.name>
MAINTAINER Cory Fabre <cfabre@gmail.com>
ENV DEBIAN_FRONTEND=noninteractive
# Install hex
View active_record_shared_connection.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
# Forces all threads to share the same connection. This works on
View deep_munge_fix.rb
# This is a monkey patch to fix the Rails deep_munge issue described here:
# https://github.com/rails/rails/issues/13420
#
# Rails converts incoming empty array params into nils. This patch reverts that.
# This goes in /config/initializers
#
# Before patch:
#
# | JSON | Hash |
# |----------------------------------|-------------------------|
View bootstrap_alert_helper.rb
def bootstrap_alert(type, message, options = {})
options.reverse_merge!(dismissable: true)
classes = %w(alert)
classes << case type
when :error, :alert
'alert-danger'
else
'alert-info'
end
View screenshot.rb
# spec/support/screenshot.rb
RSpec.configure do |config|
# A work-around to support accessing the current example that works in both
# RSpec 2 and RSpec 3.
fetch_current_example = RSpec.respond_to?(:current_example) ?
proc { RSpec.current_example } : proc { |context| context.example }
config.after do
example = fetch_current_example.call(self)