Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Lockhart codeguy

View GitHub Profile
View onename-proof
Verifying that +codeguy is my blockchain ID. https://onename.com/codeguy
View keybase.md

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 / keybase.md
Last active Aug 29, 2015
Keybase authentication
View keybase.md

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:

View drupal-launch-checklist
# Views and Blocks
* Cache views
* Export views to code
* Revert views to code
# Performance
* Enable page cache
* Enable block cache
@codeguy
codeguy / placeholders.js
Created Dec 9, 2013
Add placeholder attribute fallback for older browsers
View placeholders.js
placeholderSupport = ("placeholder" in document.createElement("input"));
if (placeholderSupport === false) {
$('[placeholder]').each(function () {
var $input = $(this),
placeholder = $input.attr('placeholder');
$input
.val(placeholder)
.focus(function () {
@codeguy
codeguy / select-state.html
Created Nov 25, 2013
US States select box
View select-state.html
<select name="state">
<option value="" selected="selected">Select a State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
View 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 / Vagrantfile
Created Nov 10, 2013
PuPHPet error information
View Vagrantfile
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)
View drupal7-bootstrap.php
<?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 / geocode-address.js
Created Sep 24, 2013
Geocode address with Google Maps API
View geocode-address.js
/**
* Geocode address
*
* REQUIREMENTS
* - Google Maps API
* - HTML5 Geolocation API
*/
var geocode = function (address, onSuccess, onError) {
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ address: address }, function (results, status) {