Skip to content

Instantly share code, notes, and snippets.

View justin808's full-sized avatar
💭
Hiring!

Justin Gordon justin808

💭
Hiring!
View GitHub Profile
@justin808
justin808 / railsonmaui-code-style.xml
Last active August 29, 2015 14:18
RailsOnMaui code style for JetBrains RubyMine and Webstorm
<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 August 29, 2015 14:17
.eslintrc based on airbnb javascript style guidelines
# 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
@justin808
justin808 / Inspection_RailsOnMaui_Default.xml
Last active August 29, 2015 14:17
RailsOnMaui Code Inspection Default for RubyMine & Webstorm
<?xml version="1.0" encoding="UTF-8"?>
<inspections version="1.0">
<option name="myName" value="Inspection RailsOnMaui Default" />
<option name="myLocal" value="true" />
<inspection_tool class="Annotator" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="AssignmentToForLoopParameterJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="BreakStatementJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="BreakStatementWithLabelJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ChainedEqualityJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CheckDtdRefs" enabled="false" level="ERROR" enabled_by_default="false" />
@justin808
justin808 / utility.zsh
Created November 15, 2014 20:13
Some utility functions that my other zsh gists use
# Generic Utilities
using_port() {
ps -p $(lsof -i:$1 -Fp | cut -c 2-)
}
most_used() {
history | awk '{a[$4]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head -20
}
@justin808
justin808 / git-helpers.zsh
Last active November 7, 2018 20:27
zsh with git flow
# depends on justin808 gist named utility.zsh
# https://gist.github.com/justin808/bdef67f37c2cbdba898a
# See forum discussion: http://forum.railsonmaui.com/t/zsh-with-git-flow/135
#### GIT ####
# http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off
# fix slow completion on files
# __git_files () {
# _wanted files expl 'local files' _files
@justin808
justin808 / assets.rake
Created September 16, 2014 19:29
Create rails-bundle.js file by using webpack. More details here: https://github.com/justin808/react-webpack-rails-tutorial.
# lib/tasks/assets.rake
# The webpack task must run before assets:environment task.
# Otherwise Sprockets cannot find the files that webpack produces.
Rake::Task['assets:precompile']
.clear_prerequisites
.enhance(['assets:compile_environment'])
namespace :assets do
# In this task, set prerequisites for the assets:precompile task
task :compile_environment => :webpack do
@justin808
justin808 / webpack.hot.config.js
Created September 16, 2014 19:16
Sample file for testing webpack bundled assets when used in the context of Rails. See https://github.com/justin808/react-webpack-rails-tutorial for more details.
var webpack = require("webpack");
var path = require("path");
module.exports = {
devtool: "source-map",
context: __dirname, // + "/../app/assets/javascripts",
entry: [
"webpack-dev-server/client?http://localhost:3000",
"webpack/hot/dev-server",
"./scripts/webpack_only",
@justin808
justin808 / webpack.rails.config.js
Created September 16, 2014 19:12
Sample file for building rails assets with webpack. See https://github.com/justin808/react-webpack-rails-tutorial for more details.
// Run like this
// cd webpack && webpack -w --config webpack.rails.config.js
var path = require("path");
var railsBundleFile = "rails-bundle.js";
var railsJsAssetsDir = "../app/assets/javascripts";
var railsBundleMapFile = railsBundleFile + ".map";
var railsBundleMapRelativePath = "../../../public/assets/" + railsBundleMapFile;
module.exports = {
# Using these pry gems -- copy to your Gemfile
# group :development, :test do
# gem 'awesome_print' # pretty print ruby objects
# gem 'pry' # Console with powerful introspection capabilities
# gem 'pry-byebug' # Integrates pry with byebug
# gem 'pry-doc' # Provide MRI Core documentation
# gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB
# gem 'pry-rescue' # Start a pry session whenever something goes wrong.
# gem 'pry-theme' # An easy way to customize Pry colors via theme files
# end
@justin808
justin808 / my_project.yml
Last active August 29, 2015 13:57
Sample Tmuxinator configuration
# First brew install tmux, gem install tmuxinator, and download item2
# Copy this file here: ~/.tmuxinator/my_project.yml
# Modify the paths (replace ~/my_project with your directory)
# Invoke with
# mux project
# Then hit 'Ctrl-a d' to detach
# Then run 'tmux -CC attach'
# Make sure that option for iterm2 is General --> tmux --> When attaching, open unrecognized windows in Tabs
# Also, check option "Automatically hide the tmux client session after connecting"
# alias beg='bundle exec guard'