Skip to content

Instantly share code, notes, and snippets.

View malachaifrazier's full-sized avatar
🏠
Working from home

Malachai malachaifrazier

🏠
Working from home
View GitHub Profile
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
XRUBY_GC_HEAP_FREE_SLOTS=4096
XRUBY_GC_HEAP_INIT_SLOTS=10000
XRUBY_GC_HEAP_GROWTH_FACTOR=1.8
XRUBY_GC_HEAP_GROWTH_MAX_SLOTS=0
{
"color_scheme": "Packages/Babel/Monokai Phoenix.tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"detect_indentation": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": false,
"file_exclude_patterns":
[
".DS_Store",
@malachaifrazier
malachaifrazier / git-log-better
Created February 16, 2017 18:57
Better git log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
And every time you need to see your log, just type in
git lg
Or, if you want to see the lines that changed
git lg -p
@malachaifrazier
malachaifrazier / Package Control.sublime-settings
Last active February 20, 2018 14:26
Package Control.sublime-settings
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"All Autocomplete",
"Babel",
"Better CoffeeScript",
@malachaifrazier
malachaifrazier / 2017-02-27T14_46_42_997Z-debug.log
Created February 27, 2017 14:50
`npm install -g learnyoumongodb` failure
```
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/7.5.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'learnyoumongodb' ]
2 info using npm@4.2.0
3 info using node@v7.5.0
4 silly loadCurrentTree Starting
@malachaifrazier
malachaifrazier / .tmux.conf
Last active April 5, 2017 15:38
tmux.conf
#!/bin/bash
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Enable native Mac OS X copy/paste
# set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'"
@malachaifrazier
malachaifrazier / rails-postgres-backbone-bootstrap-bootswatch
Created June 27, 2017 03:42 — forked from sionc/rails-postgres-backbone-bootstrap-bootswatch
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql
@malachaifrazier
malachaifrazier / database_state_loader.rb
Created July 11, 2017 19:13 — forked from keithpitt/database_state_loader.rb
Note that this code only works with PostgreSQL, but it wouldn’t be too hard to adapt our approach for other relational databases.
# Add to `spec/support/database_state_loader.rb`
class DatabaseStateLoader
class EnvironmentError < RuntimeError; end
def self.load(path)
new(path).load
end
def initialize(path)
@malachaifrazier
malachaifrazier / marketing-checklist.md
Created August 18, 2017 14:32
Side Project Marketing Checklist
layout checklist_page
title The Side Project Marketing Checklist
permalink /marketing-checklist/

Pre-Launch

Market Research

# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
require 'capybara/rails'
require 'capybara/rspec'