Skip to content

Instantly share code, notes, and snippets.

Being the richest man in the cemetery doesn't matter to me.
Going to bed at night saying we've done something wonderful.
That's what matters to me.
$(function(){
var $window = $(window);
var $header = $('.site-header');
var $windowHeight = $window.height();
var $headerHeight = $windowHeight - 20;
$header.css({'height': $headerHeight +'px'});
$window.resize(function(){
$header.css({'height': $headerHeight +'px'});
<snippet>
<content><![CDATA[
\$table->integer('${1}')->unsigned();
\$table->foreign('${1}')->references('${2:id}')->on('${3}');
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>your_key_here</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<description>Laravel Foreign Key Snippet</description>
@chadtomkiss
chadtomkiss / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@chadtomkiss
chadtomkiss / routes.php
Last active August 29, 2015 14:20
Organizing Laravel Routes
<?php
/*
Some tips on how best to organize your routes
#1 Routes should help you determine what URLs are available in your app,
so don't use Route::controller or Route::resource
because nobody will have a fucking clue.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Config Github Settings
github_username = "fideloper"
github_repo = "Vaprobash"
github_branch = "1.4.0"
github_url = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
# Server Configuration
@chadtomkiss
chadtomkiss / cache_api.php
Last active August 15, 2016 16:18
Caching API Shit
<?php
use Illuminate\Contracts\Cache\Repository as CacheRepository;
class ApiCache
{
public function __construct(CacheRepository $cache, Api $api)
{
$this->cache = $cache;
$this->api = $api;