Skip to content

Instantly share code, notes, and snippets.

Nathan Shubert-Harbison nathansh

Block or report user

Report or block nathansh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nathansh
nathansh / readme.md
Last active Jun 20, 2016
JavaScript module for a generic toggler
View readme.md

JavaScript module for a generic toggler. Main element is '.js-toggler, clicking child element .js-toggler__header adds and .is-open class to open the content (control this with CSS). Escape key and outside clicks close the most recently opened item.

View Package Control.sublime-settings
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"AutoWrap",
"Color Highlighter",
"EditorConfig",
View Preferences.sublime-settings
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ofv",
"*.ttf",
"*.tga",
@nathansh
nathansh / acf_api.php
Created Aug 2, 2015
Add ACF fields to WP JSON API V2
View acf_api.php
<?php
function d7_add_acf_to_json_api_v2($object, $field_name, $request){
if ( function_exists('get_fields') ) {
return get_fields($object['id']);
}
}
if ( is_plugin_active('rest-api/plugin.php') ) {
add_filter('rest_api_init', function(){
@nathansh
nathansh / nathansh-ascii-banner.html
Created Jun 21, 2015
nathansh.com ascii name banner
View nathansh-ascii-banner.html
<!--
_ _ _
| | | | | |
_ __ __ _| |_| |__ __ _ _ __ ___| |__ ___ ___ _ __ ___
| '_ \ / _` | __| '_ \ / _` | '_ \/ __| '_ \ / __/ _ \| '_ ` _ \
| | | | (_| | |_| | | | (_| | | | \__ \ | | || (_| (_) | | | | | |
|_| |_|\__,_|\__|_| |_|\__,_|_| |_|___/_| |_(_)___\___/|_| |_| |_|
@nathansh
nathansh / default.settings.php
Created Jun 10, 2015
Drupal 6 settings.php (sites/default/default.settings.php)
View default.settings.php
<?php
/**
* @file
* Drupal site-specific configuration file.
*
* IMPORTANT NOTE:
* This file may have been set to read-only by the Drupal installation
* program. If you make changes to this file, be sure to protect it again
* after making your modifications. Failure to remove write permissions
@nathansh
nathansh / tile.svg
Created Jun 9, 2015
Allow for background svg tile in IE
View tile.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nathansh
nathansh / apigen_command
Created Mar 31, 2015
apigen with multiple sources and options we should use
View apigen_command
apigen generate -s wp-content/themes/mount-baker-theatre/includes -s wp-content/plugins/mount-baker-theatre/includes/ -d docs --todo --deprecated --internal --template-theme=bootstrap --title='Mount Baker Theatre'
View docblock3.php
/**
* Generates markup for the show highlight tile, used on the homepage and
* show single pages.
*
* @uses mbt_show_single_date
* @uses mbt_get_acf_image
* @uses mbt_get_show_badges
* @uses mbt_get_show_venue_link
* @uses mbt_get_show_dates
* @uses mbt_get_show_presenter
@nathansh
nathansh / dockblock2.php
Created Mar 31, 2015
Simple docblock that doesn't return anything
View dockblock2.php
/**
* Prints classes for a custom menu. Prints added class and any passed in class
*
* @param string $item Slug for menu item
* @param string $classes Extra classes to print
* @uses mbt_show_listing_menu_is_current()
*
*/
You can’t perform that action at this time.