Skip to content

Instantly share code, notes, and snippets.

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"
@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
[core]
excludesfile = /home/rstovall/.gitignore
[alias]
st = status
ci = commit
co = checkout
br = branch
[user]
name = Snuggs
email = rashaun.stovall@clash-media.com
@jaybobo
jaybobo / tmux.md
Last active August 29, 2015 14:12 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
@jaybobo
jaybobo / MultiExporter.jsx
Last active August 29, 2015 14:23 — forked from TomByrne/MultiExporter.jsx
For Adobe Illustrator
// 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
@jaybobo
jaybobo / gist:7cb8c6df849b50f680620f780944e5fc
Created September 12, 2016 15:24 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

Bug Report

===================

1. Introduction

1.1 Purpose

This report provides a summary of the error results of test performed within the Staging Environment.

1.2 Scope

This summary will:

  • Identify a range of low to high priority performance bugs
  • Lists the activity and outcome of the user experience
  • Identify the bugs
@jaybobo
jaybobo / notes.md
Created July 26, 2017 02:39 — forked from monicao/notes.md
Deploying Sinatra to Heroku

It's time to deploy your app! H0Lee S#!T...
-- Khurram Virani, 2014

Introduction

Localhost is great and all, but at some point you might want to deploy other app to the wild (the internets) for others to be able to use it.

When an app is live, it’s often referred to as the "production" instance/server of your app. Your your local server (on localhost) which only you can use is referred to the "development" instance.

There are many options on how and where to deploy your web app. The simplest approach is to use a Platform as a Service (PaaS). A PaaS abstracts away many of the complexities associated with setting up, configuring and deploying to a machine in the cloud. Heroku is the most popular platform of this kind.