Skip to content

Instantly share code, notes, and snippets.

@jahio
jahio / dna.json
Created March 29, 2014 03:20
Example dna.json for Engine Yard Cloud
{
"alert_email": "email address where you want automated warnings to go",
"backup_interval": "int value for db backups, configurable on dashboard",
"backup_window": "int value for db backups, configurable on dashboard",
"ruby_version": "Ruby 1.9.3 - could be 2.0.0 or something else",
"db_host": "internal hostname of your database master",
"db_slaves": [
"db replica hosts appear here. only works with [Postgre|My]SQL"
],
"user_ssh_key": [
@jahio
jahio / keybase.md
Created April 3, 2014 00:08
keybase.md

Keybase proof

I hereby claim:

  • I am jaustinhughey on github.
  • I am jaustinhughey (https://keybase.io/jaustinhughey) on keybase.
  • I have a public key whose fingerprint is F249 E940 A507 8A0B BD55 4C71 7280 6053 CF44 4E8A

To claim this, I am signing this object:

@jahio
jahio / install.sh
Last active August 29, 2015 14:16
Install modern Ruby on Ubuntu
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y build-essential libffi-dev libgdbm-dev libncurses5-dev libreadline-dev libssl-dev libyaml-dev zlib1g-dev tmux vim git libxml2-dev libxslt1-dev libpq-dev
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
source ~/.profile && rbenv install 2.2.1 && rbenv global 2.2.1
@jahio
jahio / .editorconfig
Created September 20, 2015 19:21
My Preferred .editorconfig
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
@jahio
jahio / gist:6073520
Created July 24, 2013 19:10
Typecasting data coming out of hstore
testing=# \d foo
Table "public.foo"
Column | Type | Modifiers
--------+--------+-----------
id | uuid | not null
stuff | hstore |
Indexes:
"foo_pkey" PRIMARY KEY, btree (id)
testing=# SELECT * FROM foo;
/* Remaps the OS X home and end keys on your keyboard to go to the beginning,
and end of the line respectively. Emulates Windows behavior - one of the
few things about Windows I actually liked back in the day.
Put this file in ~/Library/KeyBindings/DefaultKeyBinding.dict. Create the
directory under ~/Library if it doesn't yet exist (~/Library should). Then
put this file in there. Rememebr to re-launch and program/process that you
want to be able to use the new keymaps in. Or just logout and log back in,
or you could reboot but that might be a little overkill.
@jahio
jahio / gist:7240249
Last active December 27, 2015 00:49
ruby test inside script
require "test/unit"
class SomeClass
end
if $0 == __FILE__
class SomeClassTestUnit < Test::Unit::TestCase
def test_something
# does something here
@jahio
jahio / riak.conf
Last active February 18, 2016 00:11
riak.conf / dev setup on os x after ulimit tweaks in docs / installed via homebrew
## Where to emit the default log messages (typically at 'info'
## severity):
## off: disabled
## file: the file specified by log.console.file
## console: to standard output (seen when using `riak attach-direct`)
## both: log.console.file and standard out.
##
## Default: file
##
## Acceptable values:
@jahio
jahio / DefaultKeyBinding.dict
Created September 5, 2015 19:57
Home and End Key Remapping - OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
// Home
"\UF729" = "moveToBeginningOfLine:";
// End
"\UF72B" = "moveToEndOfLine:";
// Shift+Home (highlight from cursor to start of line)
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
@jahio
jahio / snapshots.rb
Created June 29, 2015 22:10
ENV Snapshots for EY Cloud Client
# Assuming you've authenticated with an object named 'api'...
env = (api.environments.select { |x| x.name == "my_uniqe_env_name"}).first
env.snapshots
# big list of all environment snapshots here (array)
#
# See your app master snapshots (array):
env.snapshots.select { |x| x.role == "app_master" }