Skip to content

Instantly share code, notes, and snippets.

View kgust's full-sized avatar

Kevin Gustavson kgust

  • Vanderbilt University Medical Center
  • Nashville, Tennessee USA
View GitHub Profile
/**
* jQuery Plugin Boilerplate
*
* Call the plugin by supplying a method and/or options:
*
* $("element").myplugin();
* $("element").myplugin({ option1: true, option2: true });
* $("element").myplugin("secondary_method");
* $("element").myplugin("secondary_method", { option1: true, option2: true });
*
@kgust
kgust / MacSettings.sh
Last active August 29, 2015 13:59
MacSettings Shell Script (from Mike)
#!/usr/bin/env bash
##
# From https://github.com/mathiasbynens/dotfiles/blob/master/.osx
##
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
<?php
require 'vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';
class ExampleTest exends TestCase
{
/** @test */
function it_hashes_a_provided_password()
{
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
<?php
public function write_record() {
if(request::is_ajax()) $this->template = new View('ajax');
else die('Invalid request.');
in_array($_POST['type'], array('Sermons','Aces','Portraits','Dedications')) or die('Invalid form request.');
// Field Types
// Sermon: series, title, preacher, scripture, reader, date, disk, type
// Aces: series, title, teacher, comment, date, disk
@kgust
kgust / PHPStorm-vs-Vim.md
Last active August 29, 2015 14:03
As an ardent Vim user, I'm exploring the features of PHPStorm.

Features that PHPStorm has that Vim doesn't.

  • Better support for finding things (files, classes, methods, symbols, etc.)
  • Basic Vi keybinding support (grafted on)
    • Vi binding does not support count (e.g. 2gT)
    • Vi binding does not support surround (Vim plugin style)
  • Powerful refactoring tools
  • In-page syntax support (show Javascript in an HTML page)

Features that Vim has that PHPStorm doesn't.

@kgust
kgust / Web Performance.md
Last active August 29, 2015 14:06 — forked from michalsen/gist:8625e0736d1c9fb4a564
Web Performance Tricks

How to become a decent photographer in five years

You're not gonna become a master in your spare time, but you can get decently good at photography in five years of dedicated but non-full-time practice. It's taken me about twice that to get decent, but I fucked around a lot along the way.

You don't need a ton of fancy equipment, but photography does require some gear. I'll limit the gear-buying here to once a year (not counting books).

@kgust
kgust / vim.svg
Last active August 29, 2015 14:11 — forked from sjl/vim.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kgust
kgust / tmux.md
Last active August 29, 2015 14:15 — 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