Skip to content

Instantly share code, notes, and snippets.

View jin0x's full-sized avatar
:octocat:
Working from home

John Leskas jin0x

:octocat:
Working from home
View GitHub Profile
@jin0x
jin0x / jilt-for-wc-clear-persistent-carts.php
Created June 2, 2019 09:00 — forked from maxrice/jilt-for-wc-clear-persistent-carts.php
Jilt for WooCommerce - Clear persistent carts for customers who signed up over 30 days ago
<?php
add_filter( 'woocommerce_debug_tools', function( $tools ) {
$tools['wc_jilt_clear_persistent_carts'] = array(
'name' => __( 'Clear Persistent Carts from customers who signed up over 30 days ago.', 'jilt-for-woocommerce' ),
'button' => __( 'Clear', 'woocommerce-plugin-framework' ),
'desc' => __( 'This tool will clear the persistent cart for all registered customers who signed up over 30 days ago.', 'jilt-for-woocommerce' ),
'callback' => 'wc_jilt_clear_persistent_carts'
);
return $tools;
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@jin0x
jin0x / README.md
Created April 3, 2019 17:25 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@jin0x
jin0x / README.md
Created February 17, 2019 21:43 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@jin0x
jin0x / README.md
Created December 23, 2018 14:56 — forked from stephenway/README.md
BEMIT Cheatsheet
<?php
/*
http://stackoverflow.com/questions/12448134/social-share-links-with-custom-icons
http://petragregorova.com/articles/social-share-buttons-with-custom-icons
wp_enqueue_style('fontAwesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0', 'all');
use in template files:: <?php echo do_shortcode('[social_sharing]') ; ?>
*/
@jin0x
jin0x / nav-menu-exporter-importer.php
Created June 1, 2018 11:40 — forked from hissy/nav-menu-exporter-importer.php
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@jin0x
jin0x / custom-events-wp_query.php
Created December 5, 2017 08:39 — forked from jo-snips/custom-events-wp_query.php
The Events Calendar - Custom Query Using WP_Query
<?php
$args = array(
'post_status'=>'publish',
'post_type'=>array(TribeEvents::POSTTYPE),
'posts_per_page'=>10,
//order by startdate from newest to oldest
'meta_key'=>'_EventStartDate',
'orderby'=>'_EventStartDate',
'order'=>'DESC',
@jin0x
jin0x / functions.php
Last active November 8, 2018 00:21 — forked from mgibbs189/functions.php
FacetWP - pager handler
function fwp_pager_handler() {
?>
<script>
(function($) {
$(document).on('facetwp-refresh', function() {
if (! FWP.loaded) {
$(document).on('click', '.pagination a', function(e) {
e.preventDefault();
var matches = jQuery(this).attr('href').match(/\/page\/(\d+)/);
if (null != matches) {
@jin0x
jin0x / gist:5371dfaef3727888d61f67813a35191a
Created November 20, 2017 20:59
FacetWP custom pager
<?php
function custom_facetwp_pager( $output, $params ) {
$output = '';
$page = (int) $params['page'];
$total_pages = (int) $params['total_pages'];
// Only show pagination when > 1 page
if ( 1 < $total_pages ) {