Skip to content

Instantly share code, notes, and snippets.

View thinkryan's full-sized avatar

Ryan Dennler thinkryan

  • Centro
  • San José, Costa Rica
View GitHub Profile
@thinkryan
thinkryan / gist:3427743
Created August 22, 2012 17:26 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@thinkryan
thinkryan / gist:4033817
Created November 7, 2012 19:27 — forked from pierrejoye/gist:1949797
wpdb.php
<?php
/**
* WordPress DB Class
*
* Original code from {@link http://php.justinvincent.com Justin Vincent ([email protected])}
*
* @package WordPress
* @subpackage Database
* @since 0.71
*/
@thinkryan
thinkryan / CustomWidgetFile.php
Created November 7, 2012 19:27 — forked from jonathonbyrdziak/CustomWidgetFile.php
EMPTY WIDGET Plugin code to create a single widget in wordpress.
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
@thinkryan
thinkryan / gist:7d543d601c0d550472b6
Created October 26, 2015 12:27 — forked from JeffreyWay/gist:2889230
Simple PHP Quiz
// Fun little quiz
Assuming this string: "January 5th, 2012"
In the shortest amount of code possible, place:
- 'January' within a $month variable
- '5th' within a $day variable
- '2012' within a $year variable.
@thinkryan
thinkryan / .bashrc
Created December 10, 2015 03:47 — forked from voyeg3r/.bashrc
bashrc based on Linux mint bashrc and other stuffs
# Last Change: 2012 Jan 05 10:48:29
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# http://www.caliban.org/bash/
# Author: Sérgio Luiz Araújo Silva
# Site: http://vivaotux.blogspot.com
# twitter: http://www.twitter.com/voyeg3r
#
# ( O O )
@thinkryan
thinkryan / ajax.js
Created July 25, 2016 19:22 — forked from franz-josef-kaiser/ajax.js
AJAX in WordPress. Class based example.
( function( $, plugin ) {
"use strict";
// Working with promises to bubble event later than core.
$.when( someObjectWithEvents ).done( function() {
console.log( 'AJAX request done.' );
} )
.then( function() {
setTimeout( function() {
console.log( 'AJAX requests resolved.' );

Keybase proof

I hereby claim:

  • I am ryan4021 on github.
  • I am ryandennler (https://keybase.io/ryandennler) on keybase.
  • I have a public key whose fingerprint is F567 ABFE FCCE 30BD 7091 86EB C695 DB36 A9FF 9656

To claim this, I am signing this object:

<?php
/**
* Filter the terms query SQL clauses.
*
* @see 'terms_clauses' filter in get_terms() wp-includes/taxonomy.php
*
* @since 0.1.0
*
* @todo add filter for $allowed_orderby_keys
@thinkryan
thinkryan / us-state-names-abbrevs.php
Created February 7, 2017 14:05 — forked from maxrice/us-state-names-abbrevs.php
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
@thinkryan
thinkryan / base-admin.class.php
Created February 8, 2017 20:34
Adjust $arrMetaBoxes to be defined with array() instead of '' for additional PHP7 support
<?php
/**
* @author ThemePunch <[email protected]>
* @link http://www.themepunch.com/
* @copyright 2015 ThemePunch
*/
if( !defined( 'ABSPATH') ) exit();
class RevSliderBaseAdmin extends RevSliderBase {