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
  • RSH Creative Web Studio LTD
  • Limassol, Cyprus
  • X @john_leskas
View GitHub Profile
@jin0x
jin0x / acf-js.js
Created November 16, 2017 22:13 — forked from neilgee/acf-js.js
ACF Google Map - Get Directions Link
(function($) {
/*
* new_map
*
* This function will render a Google Map onto the selected jQuery element
*
* @type function
* @date 8/11/2013
* @since 4.3.0
@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 ) {
@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 / 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 / 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
*/
<?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 / README.md
Created December 23, 2018 14:56 — forked from stephenway/README.md
BEMIT Cheatsheet
@jin0x
jin0x / README.md
Created February 17, 2019 21:43 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@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);
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" ],