Skip to content

Instantly share code, notes, and snippets.

View jrichocean's full-sized avatar
🔱

j richardson jrichocean

🔱
View GitHub Profile

####Killing Sessions

ps aux | grep postgres
kill -9 process-number

-9 is dangerous, will force kill

####PG Restart

ps aux | grep postgres
@jrichocean
jrichocean / pair
Last active August 29, 2015 14:09 — forked from beneggett/pair
#!/usr/bin/env bash
# Usage: pair [<github-user>] [-t <tmux-session>]
#
# Copy the command to clipboard which grants another person access to the tmux
# session on your machine. The resulting command is in format:
#
# ssh -t <USER>@<HOST> 'tmux attach -t <SESSION>'
#
# When given a GitHub username, it will adopt SSH keys from their GitHub
# account and add them to your `~/.ssh/authorized_keys`.

Install needed Gems

Gemfile

group :development do
  gem 'powder'
  gem 'pry-rails'
  gem 'better_errors'
  gem 'binding_of_caller'
 gem 'meta_request'

Setting up Ruby Enviroment

Setting up your environment can be difficult when you're first starting with Ruby. We want to get the following installed:

The setup instructions are broken down for Mac.

XCode Command Line Tools

TROUBLESHOOTING

Excon Error

You may suffer an error that looks like this. It's possible you are setting up a new Mac, or you just recompiled your Ruby.

Excon::Errors::SocketError in ...
Bad address (Errno::EFAULT)

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

#!/bin/bash
NODE_VERSION=0.4.7
NPM_VERSION=1.0.94
# Save script's current directory
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#cd "${DIR}"
#
@jrichocean
jrichocean / UpdatingHomebrewPsql.md
Last active February 8, 2016 01:48
Upgrading Homebrew Postgresql from 9.4 to 9.5

Homebrew and PostgreSQL 9.5

PostgreSQL 9.5 was released on Jan. 7 2016, if you upgrade with homebrew you might come across error logs in postgres that look like:

DETAIL: The data directory was initialized by PostgreSQL version 9.4, which is not compatible with this version 9.5.0.

To upgrade from Postgres 9.4 to 9.5(which is awesome) without losing any local data, you can upgrade with these steps...

##Steps

@jrichocean
jrichocean / MultiExporter.jsx
Created March 1, 2016 23:18 — forked from TomByrne/MultiExporter.jsx
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org

##Installing Postgresql Install with Homebrew:

brew install postgresql

Note: Read the Caveats! The Homebrew installation gives extra notes to finish.

Create LaunchAgents Directory:

mkdir -p ~/Library/LaunchAgents