Skip to content

Instantly share code, notes, and snippets.

@jclay
jclay / json_mockup.json
Created May 9, 2012 04:11
JSON Mockup Kabob
{
"restaurant": {
"id": "143",
"name": "Jim N' Nicks",
"location": "1908 11th Avenue South Birmingham",
"menu": [
{
"name": "The Pulled Pork Plate",
"description": "Classic pork shoulder gently covered in our signature rub, slowly smoked, then hand-pulled.",
"includes": "barbeque sauce, big blood, raspberries",
@jclay
jclay / merchants.json
Created October 10, 2012 01:14
Mercants JSON
{"merchants":[{"id":5318,"name":"Waffle House","location_id":"waffle-house-357","address_1":"3818 University Dr NW","address_2":null,"city":"Huntsville","region":"AL","psotcode":35816,"country":"USA","latitude":34.735139,"longitude":-86.6260002,"phone":"205-837-9781","published_At":"2012-03-09","merchant_source":"SP"},{"id":5317,"name":"Waffle House","location_id":"waffle-house-356","address_1":"3613 Memorial Pkwy NW","address_2":null,"city":"Huntsville","region":"AL","psotcode":35810,"country":"USA","latitude":34.7723836,"longitude":-86.5854915,"phone":"205-883-5480","published_At":"2012-03-09","merchant_source":"SP"},{"id":3452,"name":"Pauli's Bar And Grill","location_id":"paulis-bar-and-grill","address_1":"7143 US-72 W","address_2":null,"city":"Madison","region":"AL","psotcode":35758,"country":"USA","latitude":34.75556,"longitude":-86.715,"phone":"256-722-2080","published_At":"2012-03-09","merchant_source":"SP"},{"id":3730,"name":"Popeyes Chicken & Biscuits","location_id":"popeyes-chicken--biscuits-53","a
@jclay
jclay / upmart.sql
Created November 18, 2012 06:45
uptimeMart mockup
-- A server has multiple responses
CREATE TABLE severs
(
id serial NOT NULL,
url character varying(255)
);
--Each response belongs to one and only one server
CREATE TABLE responses
(
@jclay
jclay / gist:5114559
Created March 8, 2013 06:15
Private Git repo & Heroku
#Source: http://verboselogging.com/2012/05/25/private-rubygems-on-heroku
Host heroku.com
ForwardAgent yes
/**
* Hide the addressbar on ios & android devices
* https://gist.github.com/yckart/5609969
*
* Based on the work from Nate Smith
* @see https://gist.github.com/nateps/1172490
*
* Copyright (c) 2013 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/05/20
@jclay
jclay / git_cheatsheet.md
Last active December 24, 2015 01:09
Git cheatsheet

Set username
git config --global user.name "Your Name Here"

Set e-mail
git config --global user.email "your_email@example.com"

Clorize and make git output pretty
git config --global color.ui true

Creating a repository

@jclay
jclay / vagrant_chef.md
Created October 3, 2013 17:10
Detecting whether you're running Vagrant in your Chef attributes file

I wanted to have a way to specify some attributes based on whether or not I was running in Vagrant. According to other resources on the web it looks like Vagrant used to set the vagrant attribute for us but no longer does so we need to manually specify it.

Vagrantfile

  ...
    config.vm.provision :chef_solo do |chef|
      chef.json = {
        vagrant: true 
 }
@jclay
jclay / gist:9646714
Created March 19, 2014 17:21
Include vendor/assets files in the asset pipeline for rails 4.x

Add the following to production.rb

config.assets.precompile += Dir.glob(Rails.root.join('vendor/assets/**/*')).select { |f| File.file?(f) }
@jclay
jclay / gist:be206448fce31651407f
Created July 27, 2015 16:59
Using active_job test helpers with RSpec
require 'active_job'
RSpec.configure do |config|
config.include ActiveJob::TestHelper
end
@jclay
jclay / Gemfile
Last active September 1, 2015 22:52
checkr - stack level too deep
source "https://rubygems.org"
gem 'activesupport', '4.2.3'
gem 'checkr-official', '1.0.2'