Skip to content

Instantly share code, notes, and snippets.

@jaybobo
jaybobo / .vimrc
Last active August 29, 2015 14:12 — forked from snuggs/.vimrc
" ********************************************************************************
" Settings
" ********************************************************************************
filetype off
filetype plugin indent on " if you switch off filetype plugin detection,
" the plugins will not be loaded
" Set filetype to Ruby
autocmd BufNewFile,BufRead Gemfile set filetype=ruby
syntax enable

How to embed HATEOAS/Link inside JSON

HTTP Headers

For HTTP headers it's quite straightforward: draft-nottingham-http-link-header defines this.

Link: <http://example.com/>; rel="previous"; titile="Previous chapter"
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
# Symbolizes all of hash's keys and subkeys.
# Also allows for custom pre-processing of keys (e.g. downcasing, etc)
# if the block is given:
#
# somehash.deep_symbolize { |key| key.downcase }
#
# Usage: either include it into global Hash class to make it available to
# to all hashes, or extend only your own hash objects with this
# module.
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Render and Redirect

The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render in a controller when we want to respond within the current request, and redirect_to when we want to spawn a new request.

Render

The render method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form' or render @post.comments, but here we'll focus on usage within the controller.

:action

@jaybobo
jaybobo / Answers.md
Last active August 29, 2015 14:01 — forked from tennety/IntroClues.md

#firstguess

1 8 each 10 cycle 11 partition 12 .shuffle

2 initialize

<html>
<head>
<title>Topic Clouds</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="http://d3js.org/d3.v2.min.js?2.10.0"></script>
<script type="text/javascript" src="d3.layout.cloud.js"></script>
</head>
<body>
<script>

Process

  • Phone
  • Tech
    • Pairing
    • Whiteboarding
  • Culture

What should you get out of the interview process?