Skip to content

Instantly share code, notes, and snippets.

<?php
//* Do NOT include the opening php tag
//* Enqueue Animate.CSS and WOW.js
add_action( 'wp_enqueue_scripts', 'sk_enqueue_scripts' );
function sk_enqueue_scripts() {
wp_enqueue_style( 'animate', get_stylesheet_directory_uri() . '/css/animate.min.css' );
wp_enqueue_script( 'wow', get_stylesheet_directory_uri() . '/js/wow.min.js', array(), '', true );
@machouinard
machouinard / facetwp-infinite-scroll.js
Created March 10, 2016 09:49
FacetWP inifinite scroll using button click
(function ( $ ) {
window.fwp_is_paging = false;
$( document ).on( 'facetwp-refresh', function () {
if ( !window.fwp_is_paging ) {
window.fwp_page = 1;
FWP.extras.per_page = 'default';
}
window.fwp_is_paging = false;
// Move Footer widgets and Footer outside Site Container
// Reposition the footer widgets
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
add_action( 'genesis_after', 'genesis_footer_widget_areas' );
// Reposition the footer
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
@machouinard
machouinard / fib.php
Created January 21, 2016 19:33
Fibonacci generator
function fib( $num ) {
$last = 0;
$current = 1;
yield $current;
while ($current < $num ) {
$current = $last + $current;
$last = $current - $last;
yield $current;
}
}
@machouinard
machouinard / Contract Killer 3.md
Last active August 29, 2015 14:27
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
<?php
function tott_enable_menu_export() {
global $wp_post_types;
$wp_post_types['nav_menu_item']->_builtin = false;
}
add_action( 'load-export.php', 'tott_enable_menu_export' );
<?php
/**
* Plugin Name: Force Strict OFF
* Description: Forces Strict errors off
* Author: John P. Bloch
* Version: 0.1
* License: GPLv2
*/
if ( WP_DEBUG ) {
def screenshotFilter(poi):
'''This looks for signs that have their first line in the 'Image:<id>' format, where <id> is an
id from an Imgur.com image.'''
if poi['id'] == 'Sign':
if poi['Text1'].startswith('Image:'):
poi['icon'] = "painting_icon.png"
image_html = "<style>.infoWindow img[src='{icon}'] {{display: none}}</style><a href='http://imgur.com/{id}'><img src='http://imgur.com/{id}s.jpg' /></a>".format(icon=poi['icon'], id=poi['Text1'][6:])
return "\n".join([image_html, poi['Text2'], poi['Text3'], poi['Text4']])
def playerFilter(poi):