Skip to content

Instantly share code, notes, and snippets.

View tychay's full-sized avatar

terry chay tychay

View GitHub Profile
@tychay
tychay / 1_install_ansible_20_from_source
Last active September 30, 2016 14:39
Ansible 2.0 with Digital Ocean v2
$ git clone git://github.com/ansible/ansible.git --recursive
$ cd ansible
$ source ./hacking/env-setup
$ sudo pip install paramiko PyYAML Jinja2 httplib2 six
$ make
$ sudo make install
@tychay
tychay / config.js
Last active March 1, 2017 19:05 — forked from pywebdesign/config.js
Restangular adapter to expand compound documents from jsonapi.org
// This variation just injects the extracted data right into the relationships and also stores things in
// ._meta and ._included instead of just .included
// it (like restangular) requires either lodash or underscorejs
.config(function(RestangularProvider) {
// add a response interceptor
RestangularProvider.addResponseInterceptor(function(data, operation, what, url, response, deferred) {
var extractedData = data.data;
@tychay
tychay / patch_picturefill_to_ignore_feeds.php
Created April 24, 2015 02:58
Attempted patch to https://github.com/kylereicks/picturefill.js.wp/issues/47 so that picturefill doesn't mess with rss feeds.
<?php
function apply_picturefill_to_content_not_feed($html, $cache = null) {
if ( is_feed() ) { return $html; }
return Picturefill_WP::get_instance()->picturefill_wp_apply_to_html($html, $cache);
}
remove_filter( 'the_content', array( Picturefill_WP::get_instance(), 'picturefill_wp_apply_to_html' ), apply_filters('picturefill_wp_the_content_filter_priority', 11) );
add_filter ( 'the_content, 'apply_picturefill_to_content_not_feed', apply_filters('picturefill_wp_the_content_filter_priority', 11) );
@tychay
tychay / 0_fywp-wpautop-shortcode-oembed.md
Last active August 29, 2015 14:18
FYWP Reason #257-59: wpautop / shortcode / embed nightmares
@tychay
tychay / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console