Skip to content

Instantly share code, notes, and snippets.

View joshuaadrian's full-sized avatar

Joshua Adrian joshuaadrian

View GitHub Profile
@joshuaadrian
joshuaadrian / US States PHP Array
Created February 25, 2014 16:19
With state abbreviations for keys
$us_states = array(
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
'DE' => 'Delaware',
'DC' => 'District Of Columbia',
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
$.fn.pluginName = function(options) {
this.each(function() {
var settings = $.extend({
'key1' : 'value1',
'key2' : 'value2',
'key3' : 'value3'
}, options);
function Example(el) {
this.el = el;
function something() {
// Do code here
}
var ajaxTemplate = {
init: function() {
$('.parentElement').on( 'click', '.dynamicChildElement', this.ajaxCall )
},
ajaxCall: function() {
$.ajax('/relative_file_path.php', {
$('.parentElement').on('click', '.dynamicChildElement', function() {
$.ajax('/relative_file_path.php', {
type: "POST", // Defaults to get
data: {
'key' : 'value',
'key' : 'value'
},
dataType: 'json', // If retrieving JSON
contentType: 'application/json', // If retrieving JSON
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
<?php
/* ABSOLUTE PATH */
if ( !defined( 'ABSPATH' ) ) :
define('ABSPATH', dirname(__FILE__) . '/');
endif;
/* DB CREDS */
if ( file_exists( ABSPATH . 'wp-config.local.php' ) ) :
require_once( 'wp-config.local.php' );
/************************************************************************/
/* NAME
/************************************************************************/
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->