Skip to content

Instantly share code, notes, and snippets.

@ryanpcmcquen
ryanpcmcquen / README.md
Last active March 13, 2016 00:40
modularThrottle.js
@ryanpcmcquen
ryanpcmcquen / htget
Last active October 29, 2015 00:53
htget
#!/bin/sh
##
## wget -N https://gist.githubusercontent.com/ryanpcmcquen/271d889c1a5a21029c9e/raw/htget -P /usr/local/bin/ && chmod 755 /usr/local/bin/htget
##
## run as:
## htget example.com
##
## NOTE: you have to feed httrack the correct
## version of the site, either www or non-www
SITE=$1
@neilgee
neilgee / selective.php
Last active March 5, 2021 02:05
WooCommerce Conditionally Removing Scripts and Styles
<?php
add_action( 'template_redirect', 'bt_remove_woocommerce_styles_scripts', 999 );
/**
* Remove Woo Styles and Scripts from non-Woo Pages
* @link https://gist.github.com/DevinWalker/7621777#gistcomment-1980453
* @since 1.7.0
*/
function bt_remove_woocommerce_styles_scripts() {
// Skip Woo Pages
@rileypaulsen
rileypaulsen / functions.php
Created August 19, 2014 16:08
Add Advanced Custom Fields Fields to the WP REST API
function wp_api_encode_acf($data,$post,$context){
$data['meta'] = array_merge($data['meta'],get_fields($post['ID']));
return $data;
}
if( function_exists('get_fields') ){
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3);
}
@brianoz
brianoz / class-virtualthemedpage-bc.php
Created February 20, 2014 01:10
WordPress Virtual page with theme
<?php
/*
* Virtual Themed Page class
*
* This class implements virtual pages for a plugin.
*
* It is designed to be included then called for each part of the plugin
* that wants virtual pages.
*
* It supports multiple virtual pages and content generation functions.
@shaneriley
shaneriley / mixins.jade
Created February 10, 2014 20:10
Jade mixins example
// Writing JS for everything is great and all, but I don't want to see JS
// inline in my Jade templates. Thankfully, there are ways of abstrating it
// into mixins!
// Want some Rails-like helpers?
mixin link_to(name, href)
- href = href || "#"
a(href="#{href}")= name
// How about a single editing point for a class name?
@ericrasch
ericrasch / TypeKit embed code.php
Last active July 4, 2017 03:54
Different methods for loading TypeKit's embed code.
<?php
/**
* TypeKit's default embed code.
* Source: http://help.typekit.com/customer/portal/articles/649336-embed-code
* Avg. Load Time: 191ms; 198ms; 265ms
*/
?>
<script type="text/javascript" src="//use.typekit.net/xxxxxxx.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
@Cuboctaedro
Cuboctaedro / extend.php
Created November 20, 2013 13:32
An extension of Kirbytext for creating a custom "figure" tag for images with complex captions.
<?php
class kirbytextExtended extends kirbytext {
function __construct($text, $markdown=true) {
parent::__construct($text, $markdown);
$this->addTags('figure');
@wilkerlucio
wilkerlucio / example.scss
Last active May 20, 2019 15:12 — forked from darren131/gist:3410875
Compass sprite resize mixin
$my-icons-spacing: 10px; // give some space to avoid little pixel size issues on resize
@import "my-icons/*.png";
$my-icons-sprite-dimensions: true;
@include all-my-icons-sprites;
// the fun part