Skip to content

Instantly share code, notes, and snippets.

🍜
Ramen connoisseur

Jess Green jesgs

🍜
Ramen connoisseur
View GitHub Profile
@jesgs
jesgs / wp-framework-example.php
Last active Oct 13, 2015
WordPress Post-Type Framework Example
View wp-framework-example.php
<?php
add_action('init', 'theme_post_types');
/**
* Reqister Post-Types
*
* @return void
*/
function theme_post_types()
{
//example #1:
@jesgs
jesgs / us-states-php-arrays.php
Last active Dec 11, 2015
US States PHP Arrays
View us-states-php-arrays.php
<?php
/* States */
$us_states = array(
'alabama' => 'Alabama',
'alaska' => 'Alaska',
'arizona' => 'Arizona',
'arkansas' => 'Arkansas',
'california' => 'California',
'colorado' => 'Colorado',
@jesgs
jesgs / us-states-acf-fields.txt
Last active Dec 11, 2015
US States (For Advanced Custom Fields drop-downs)
View us-states-acf-fields.txt
AL : ALABAMA
AK : ALASKA
AS : AMERICAN SAMOA
AZ : ARIZONA
AR : ARKANSAS
CA : CALIFORNIA
CO : COLORADO
CT : CONNECTICUT
DE : DELAWARE
DC : DISTRICT OF COLUMBIA
@jesgs
jesgs / us-states.html
Created Jan 16, 2013
US States (HTML)
View us-states.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 zip-code-range.php
<?php
/**
* Retrieve range of zip codes within given radius as
* determined by $rad
* Taken from http://www.movable-type.co.uk/scripts/latlong-db.html
*
* @global wpdb $wpdb
*
* @param integer $zip Zip code to query for
* @param integer $radius Radius in miles
@jesgs
jesgs / walker-category.php
Last active Dec 11, 2015
Add checkboxes to categories using a Walker class and wp_list_categories
View walker-category.php
<?php
/**
* My Project
*
* @package MyProject
* @subpackage JesGs_Walker_Category
* @author Jess Green <jgreen@psy-dreamer.com>
* @version $Id$
*/
@jesgs
jesgs / vimrc
Last active Dec 13, 2015
Vim config file
View vimrc
" General
set number
set showbreak=+++
set showmatch
set visualbell
"set mouse=a "for mouse support
set hlsearch
set smartcase
set ignorecase
@jesgs
jesgs / bashrc
Last active Dec 13, 2015
bashrc file
View bashrc
export APPLICATION_ENV=development
export SVN_EDITOR='/usr/bin/vim'
alias la='ls -la --color'
PS1="[\h:\\W] $ "
#source ~/.gitsource
@jesgs
jesgs / class.image-size.php
Last active Dec 14, 2015
Image size class for WordPress
View class.image-size.php
<?php
/**
* ImageSizes
* Define and create image sizes
*
* @todo Add setter method for adding image sizes
*
* @package ImageSizes
* @author Jess Green <jgreen@psy-dreamer.com>
* @version $Id$
View image-sizes-fix.php
<?php
/**
* Add image sizes to Insert Into Post list
* @see http://goo.gl/CJdR4
*
* @param array $sizes
* @return array
*/
add_filter('image_size_names_choose', 'display_image_size_names', 11, 1);
function display_image_size_names($sizes)
You can’t perform that action at this time.