Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Hiring!

Justin Gordon justin808

💭
Hiring!
View GitHub Profile
@justin808
justin808 / Gemfile
Created Nov 12, 2015
Octopress 3 Gemfile
View Gemfile
source "https://rubygems.org"
gem "octopress", "~>3"
gem "jekyll", "<3"
group :jekyll_plugins do
gem "octopress-asset-pipeline"
end
@justin808
justin808 / rails_helper.rb
Created Sep 7, 2015
rails_helper with setup for Capybara feature tests, allowing JavaScript driver to be set by setting DRIVER environment variable.
View rails_helper.rb
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../config/environment", __FILE__)
require "rspec/rails"
require "rspec/mocks"
require "capybara/rspec"
require "vcr"
require "rails/application"
require "webmock/rspec"
require "shoulda/matchers"
require "capybara-screenshot/rspec"
@justin808
justin808 / check_db_version.rb
Created Sep 6, 2015
Check DB Version -- place this in config in your Rails app to ensure the team uses the same db version. Change line to match your expected DB.
View check_db_version.rb
# Method to check the DB version matches
# We ran into an issue where different versions of postgres caused inconsistent results.
def check_db_version
expected_db_version = "PostgreSQL 9.4"
adapter = ActiveRecord::Base.connection.adapter_name
sql = case adapter
when "MSSQL"
"SELECT @@VERSION"
when "MySQL", "Mysql2", "PostgreSQL"
"SELECT VERSION()"
@justin808
justin808 / bundle-global.js
Created Jul 17, 2015
Simplest Hello World Webpack output with global export
View bundle-global.js
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@justin808
justin808 / bundle.js
Created Jul 17, 2015
Simplest Hello World Webpack output
View bundle.js
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
View .tmux.conf
set-option -g default-shell /bin/zsh
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
# http://brentvatne.github.com/tmux-copy-paste/
# this next command takes the current buffer and puts it on the OS clipboard
#bind Y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
#
# I don't understand why the next would be useful
# bind P run "tmux paste-buffer"
bind y copy-mode
@justin808
justin808 / pgk.zsh
Last active Apr 10, 2017
Script to kill errant rails development processes
View pgk.zsh
export PROCESSES_TO_QUIT='bpos puma rake sidekiq spring rails$ ruby-debug phantomjs zeus passenger guard resque "node server.js" ruby$ node foreman fsevent_wat'
pgr() {
echo "Finding processes in list: $PROCESSES_TO_QUIT"
echo $PROCESSES_TO_QUIT | xargs -n 1 pgrep -l
}
pgk() {
echo "Killing processes in list: $PROCESSES_TO_QUIT"
echo $PROCESSES_TO_QUIT | xargs -n 1 pkill -l
View railsonmaui-rails.zsh
# Kill stuff
pgr() {
for x in rake spring rails ruby-debug phantomjs zeus passenger guard resque "node server.js"; do
pgrep -fl $x;
done
}
pgk() {
for x in rake spring rails ruby-debug phantomjs zeus passenger guard resque "node server.js"; do
@justin808
justin808 / railsonmaui-code-style.xml
Last active Aug 29, 2015
RailsOnMaui code style for JetBrains RubyMine and Webstorm
View railsonmaui-code-style.xml
<code_scheme name="RailsOnMaui Code Style">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
@justin808
justin808 / .eslintrc
Last active Aug 29, 2015
.eslintrc based on airbnb javascript style guidelines
View .eslintrc
# ESLint documentation can be found at http://eslint.org/docs/
# find . -path ./node_modules -prune -o -name "*.js" -o -name "*.jsx" -exec eslint {} \;
parser: "babel-eslint"
plugins: ["react"]
ecmaFeatures:
jsx: true
env:
browser: true
node: true
amd: false