Skip to content

Instantly share code, notes, and snippets.

View codeguy's full-sized avatar

Josh Lockhart codeguy

View GitHub Profile
@codeguy
codeguy / keybase.md
Last active August 29, 2015 13:57
Keybase authentication

Keybase proof

I hereby claim:

  • I am codeguy on github.
  • I am codeguy (https://keybase.io/codeguy) on keybase.
  • I have a public key whose fingerprint is 14FD 6412 E8DB CEAB 0A5D 5DDE D65C 2F1A 3BEB B461

To claim this, I am signing this object:

@codeguy
codeguy / keybase.md
Created March 31, 2015 22:15
Keybase proof

Keybase proof

I hereby claim:

  • I am codeguy on github.
  • I am codeguy (https://keybase.io/codeguy) on keybase.
  • I have a public key whose fingerprint is 0B93 1A2B B0BD 8B4F D938 B49C 606D 6E29 F8F2 5B12

To claim this, I am signing this object:

@codeguy
codeguy / gist:2396070
Created April 16, 2012 02:31
Test Gist
<?php
require 'Slim/Slim.php';
$app = new Slim();
$app->get('/hello/:name', function ($name) {
echo "Hello, $name!";
});
$app->run();
?>
@codeguy
codeguy / index.html
Last active December 19, 2015 10:59
HTML Boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<title>My Document</title>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="/css/all.css"/>
<link rel="shortcut icon" href="/images/favicon.ico"/>
@codeguy
codeguy / console.js
Created July 8, 2013 03:52
A wrapper for `console.log` for browsers that lack support (e.g. IE)
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function () {
log.history = log.history || [];
log.history.push(arguments);
if (this.console) {
console.log(Array.prototype.slice.call(arguments));
}
};
@codeguy
codeguy / mysql-create-table.sql
Created September 20, 2013 13:48
MySQL Create Table
DROP TABLE IF EXISTS table_name;
CREATE TABLE table_name (
) ENGINE=INNODB DEFAULT CHARSET=UTF8 COLLATE=UTF8_UNICODE_CI;
@codeguy
codeguy / drupal7-bootstrap.php
Created September 30, 2013 17:44
Bootstrap Drupal 7
<?php
// Required settings
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
define('DRUPAL_ROOT', '/path/to/public');
// Bootstrap
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
@codeguy
codeguy / Vagrantfile
Created November 10, 2013 02:51
PuPHPet error information
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu-precise12042-x64-vbox43"
config.vm.box_url = "https://puphpet.s3.amazonaws.com/ubuntu-precise12042-x64-vbox43.box"
config.vm.network "private_network", ip: "192.168.56.101"
config.vm.synced_folder "./", "/var/www", id: "vagrant-root", :nfs => true
config.vm.usable_port_range = (2200..2250)
@codeguy
codeguy / vim-version
Created November 12, 2013 17:42
vim --version
/usr/bin/vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 2 2013 02:51:11)
Compiled by root@apple.com
Normal version without GUI. Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent
@codeguy
codeguy / placeholders.js
Created December 9, 2013 15:50
Add placeholder attribute fallback for older browsers
placeholderSupport = ("placeholder" in document.createElement("input"));
if (placeholderSupport === false) {
$('[placeholder]').each(function () {
var $input = $(this),
placeholder = $input.attr('placeholder');
$input
.val(placeholder)
.focus(function () {