Skip to content

Instantly share code, notes, and snippets.

View edge.md
View smart-slider-3-infogram.js
jQuery(window).on("message", function(e) {
if(e.originalEvent.origin === 'https://e.infogram.com'){
var data = e.originalEvent.data;
if(typeof data === 'string' && data.substr(0, 12) === 'iframeHeight'){
setTimeout(function(){
jQuery(window).trigger('SliderContentResize');
}, 200);
}
}
});
@nextend
nextend / block.js
Created Nov 9, 2018
Gutenberg block.js Smart Slider 3
View block.js
(function (blocks, editor, i18n, element, components, _) {
var el = element.createElement;
blocks.registerBlockType('nextend/smartslider3', {
title: 'Smart Slider 3',
icon: 'welcome-learn-more',
category: 'common',
attributes: {
slider: {
type: 'string'
@nextend
nextend / block.php
Created Nov 9, 2018
Gutenberg block.php Smart Slider 3
View block.php
<?php
defined('ABSPATH') || exit;
class NextendSmartSlider3Gutenberg {
public function __construct() {
add_action('enqueue_block_editor_assets', array(
$this,
'enqueue_block_editor_assets'
@nextend
nextend / test.php
Last active Jun 15, 2018
Curl verbose Facebook api test
View test.php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/v2.12/oauth/access_token");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "postvar1=value1&postvar2=value2&postvar3=value3");
curl_setopt($ch, CURLOPT_VERBOSE, true);
@nextend
nextend / fix-insert-php-code-snippet.php
Last active Jun 8, 2018
Fix for Insert PHP Code Snippet output buffer issue
View fix-insert-php-code-snippet.php
<?php
/*
Plugin Name: Fix: Insert PHP Code Snippet output buffer issue
Author: nextendweb
Version: 1.0.0
Requires at least: 4.1
Tested up to: 4.9
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
View fix.php
<?php
add_action('plugins_loaded', 'fix_insert_php_code_snippet');
function fix_insert_php_code_snippet() {
add_shortcode('xyz-ips', 'mod_xyz_ips_display_content');
}
function mod_xyz_ips_display_content($xyz_snippet_name) {
global $wpdb;
if (is_array($xyz_snippet_name)) {
View gist:fce67d264b3f7f6d2a76dcc52168eb71
<?php
//Original
function zeo_final_title(){
// Use object to avoid namespace collisions
$zeo_rewrite_title = new zeo_rewrite_title();
// We want to act when the page is 99% complete
add_action('wp_footer', array(&$zeo_rewrite_title, 'wpzeo_footer'));
View nsl-username-length.php
<?php
/*
Plugin Name: Nextend Social Login - Username length
*/
add_filter('nsl_validate_username', function ($isValid, $username, $errors) {
if (strlen($username) < 6) {
$errors->add('invalid_username', '<strong>' . __('ERROR') . '</strong>:' . __('Sorry, username must contain at least 6 characters.'));
$isValid = false;
}
View result.html
<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 120" preserveAspectRatio="none"><br />
<g class="n2-ss-divider-start">
<path fill="RGBA(255,255,255,1)" opacity="0.25" d="M1920,0 0,120 0,0z" duration="1" delay="0" data-original="M1920,0 0,0 0,0z"></path>
<path fill="RGBA(255,255,255,1)" opacity="0.5" d="M1920,0 0,80 0,0z" duration="1" delay="0.2" data-original="M1920,0 0,0 0,0z"></path>
<path fill="RGBA(255,255,255,1)" d="M1920,0 0,40 0,0z" duration="1" delay="0.4" data-original="M1920,0 0,0 0,0z"></path>
</g><br />
<g class="n2-ss-divider-end">
<path fill="RGBA(255,255,255,1)" opacity="0.25" d="M1920,0 0,120 0,0z"></path>
<path fill="RGBA(255,255,255,1)" opacity="0.5" d="M1920,0 0,80 0,0z"></path>
<path fill="RGBA(255,255,255,1)" d="M1920,0 0,40 0,0z"></path>