Skip to content

Instantly share code, notes, and snippets.

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
config.vm.network :private_network, ip: '192.168.50.5'
@cfxd
cfxd / chosenjs-less-for-bootstrap-and-woocommerce-checkout.less
Last active August 29, 2015 14:03
This will style WooCommerce's ChosenJS select boxes on the WooCommerce checkout page to match your existing Bootstrap form styles (assuming you've made any style changes in LESS) and even replaces the default background images with Bootstrap's built in Glyphicons.
// first some helpful mixins
.abs {
position: absolute;
}
.rel {
position: relative;
}
.position(@top; @right; @bottom; @left) {
top: @top;
right: @right;
@cfxd
cfxd / gf.php
Created November 13, 2014 17:49
Populate Gravity Forms in an ACF select field named "subscribe_form_header"
<?php
function populate_gravity_forms($field) {
if(class_exists('RGFormsModel')) {
$forms_array = array();
$forms = RGFormsModel::get_forms(null, 'title');
foreach($forms as $form) {
$forms_array[$form->id] = $form->title;
@austinpray
austinpray / Smart-Checkboxes.markdown
Last active August 29, 2015 14:15
Smart Checkboxes
<?php
/*
Plugin Name: Image Optimizer
Plugin URI:
Description: Automatically optimizes images using jpegtran and optipng on upload
Version: 0.1
Author: Scott Walkinshaw
Author URI:
Support URI:
*/
@NateWr
NateWr / imager-for-wp.php
Created March 12, 2014 01:07
Integrate Imager.js with WordPress
<?php
/**
* Integrate Imager.js with WordPress
*
* Imager.js is BBC's solution for serving responsive and retina images, without
* the double payload issues that affect other solutions. For more information:
*
* https://github.com/BBC-News/Imager.js/
*
* This collection of functions modifies the output of WordPress's
@leemartin
leemartin / slots.coffee
Last active June 23, 2020 13:05
CSS3 Slot Machine
$ ->
result = []
count = 0
# Loop through each reel
$('.reel-outer'). each ->
$this = $(this)
index = $this.index()
spinPlus = 0
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@smockle
smockle / Flip.css
Created May 9, 2013 19:45
Flip demonstrates a flip animation using CSS. Tested in Google Chrome 26, IE 10, and Firefox Nightly.
/* entire container, keeps perspective */
body .flip-container {
width: 100%;
}
body .flip-container .flipper {
position: relative;
}
/* hide back of pane during swap */
@levymetal
levymetal / direct_parent.php
Last active November 27, 2023 04:17
Custom Wordpress function which uses a nav walker to display a list of child pages from a common parent, which can be called from either the parent page (displays children) or any of the child pages (displays siblings). Detailed instructions available on my blog post here: http://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-…
<?php
wp_nav_menu( array(
'menu' => 'Menu Name',
'sub_menu' => true,
'direct_parent' => true
) );