Skip to content

Instantly share code, notes, and snippets.

View codeguy's full-sized avatar

Josh Lockhart codeguy

View GitHub Profile
@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 / select-state.html
Created November 25, 2013 18:47
US States select box
<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>
@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 () {
# Views and Blocks
* Cache views
* Export views to code
* Revert views to code
# Performance
* Enable page cache
* Enable block cache
@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:

Verifying that +codeguy is my blockchain ID. https://onename.com/codeguy