Skip to content

Instantly share code, notes, and snippets.

View radist2s's full-sized avatar

Alex Batalov radist2s

  • Georgia, Tbilisi
  • 10:36 (UTC +04:00)
View GitHub Profile
@radist2s
radist2s / functions.php
Last active July 9, 2023 10:07 — forked from jaredatch/gist:11239971
Create ACF options page under custom post type menu
<?php
/**
* Create ACF options page under custom post type menu
*
* @since 1.0.0
*/
if ( function_exists( 'acf_add_options_sub_page' ) ){
acf_add_options_sub_page(array(
'title' => 'Event Settings',
'parent' => 'edit.php?post_type=events',
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@radist2s
radist2s / RequestAnimationFrame.js
Last active November 29, 2015 14:52 — forked from paulirish/rAF.js
RequestAnimationFrame Polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
!window.requestAnimationFrame && (window.requestAnimationFrame = null)
!window.cancelAnimationFrame && (window.cancelAnimationFrame = null)
/**
* jQuery.reduce - a jQuery plugin for functional programming
* @author Alex Batalov, John Hunter
* use: $('.elements').reduce(function(memo){return memo + $(this).height()}, 0);
* fnReduce is called with arguments: [valueInitial, value, i, arr]
*
* created 2010-09-17
* modiffied 2013-12-09
*/