Skip to content

Instantly share code, notes, and snippets.

@nextend
nextend / gist:7986647
Last active December 31, 2015 12:29 — forked from alexindigo/gist:1871785
Internet explorer 11 support added
// {{{ win-safari hacks, scratch this,
// let's just expose platform/browser to css
(function()
{
var uaMatch = '', prefix = '';
if (navigator.userAgent.match(/Windows/))
{
$('html').addClass('x-win');
}
@nextend
nextend / gist:66709844688f69d1beb8
Last active August 29, 2015 14:13
Aviary: Check if the app has access to the High resolution feature
var featherEditorHiRes = -1;
var featherEditor = new Aviary.Feather({
...
onReady: function(){
if(featherEditorHiRes == -1){
AV.controlsWidgetInstance.serverMessaging.sendMessage({
id: "avpw_auth_form",
action: AV.controlsWidgetInstance.assetManager.getManifestURL(),
method: "GET",
@nextend
nextend / magento-packager.js
Created July 30, 2015 06:55
Create Magento extension xml with nodejs as a build process
var fs = require('fs'),
path = require('path'),
builder = require('xmlbuilder'),
crypto = require('crypto');
var targetDir = process.argv[2] + '/',
magentoVersion = process.argv[3];
function xmlAddSyncRecursive(xml, cpath, failSilent) {
var files;
@nextend
nextend / export.js
Created August 31, 2015 05:54
Export multiple selected layers from Photoshop with scripting
app.activeDocument.suspendHistory("Export as png", "main()");
function main() {
if (app.documents.length) {
var docRef = app.activeDocument;
if (docRef.layers.length) {
var selected = getSelectedLayersIdx();
for (var i = 0; i < selected.length; i++) {
var layer = selectByIndex(selected[i]),
width = layer.bounds[2] - layer.bounds[0],
@nextend
nextend / NextendMultiLineShortcode.php
Created May 10, 2016 13:08
WordPress multiline shortcode with wpautop support
class NextendMultiLineShortcode{
static $multiline_shortcode_storage = array();
static $multiline_shortcodes = array();
public static function init(){
add_filter('the_content', 'NextendMultiLineShortcode::do_multiline_shortcode', 9); // before wpautop()
add_shortcode('multiline_shortcode', 'NextendMultiLineShortcode::multiline_shortcode');
}
public static function do_multiline_shortcode($content, $ignore_html = false) {
@nextend
nextend / isBefore.js
Created May 15, 2017 14:12 — forked from xilin/isBefore.js
Compare DOM tree order of elements
// http://stackoverflow.com/questions/3860351/relative-position-in-dom-of-elements-in-jquery
// What this does is .add() the additional element (or selector)
// (which jQuery keeps in document order) and then checks if it's the second of the two.
(function($) {
$.fn.isBefore = function(elem) {
if(typeof(elem) == "string") elem = $(elem);
return this.add(elem).index(elem) > 0;
}
})(jQuery)
@nextend
nextend / PHP - Clear and close all non-lethal output buffers ob_end_clean_all
Last active October 19, 2017 07:02
Before you want to send files or structured data over and AJAX call from PHP you might need to clean all output buffers (ob_start(...)) to be able to trash the junk in the buffers. It especially can happen in CMS like Joomla, WordPress etc.. when other plugin does strange things.
<?php
function ob_end_clean_all() {
$handlers = ob_list_handlers();
while (count($handlers) > 0 && $handlers[count($handlers) - 1] != 'ob_gzhandler' && $handlers[count($handlers) - 1] != 'zlib output compression') {
ob_end_clean();
$handlers = ob_list_handlers();
}
}
Hi, there is not such ready-to-use feature in Smart Slider, but you can do what you need.
You need to separate it into two task:
Task #1: On page load, scroll the browser to the slider with id 31:
<script type="text/javascript">
jQuery(window).on('ready', function() {
jQuery('html, body').scrollTop($('#n2-ss-31').offset().top);
});
</script>
@nextend
nextend / nsl-usage.php
Created February 15, 2018 09:47
Nextend Social Login - How to display buttons in themes or custom login forms
<?php
if(class_exists('NextendSocialLogin', false)){
NextendSocialLogin::renderButtonsWithContainer();
}
@nextend
nextend / nsl-default-buttons-with-container.html
Created February 15, 2018 09:55
Nextend Social Login - HTML markup of the buttons and container
<div class="nsl-container nsl-container-block nsl-container-login-layout-below-separator" style="display: block;">
<a href="***?loginSocial=facebook" rel="nofollow" aria-label="Continue with <b>Facebook</b>" data-plugin="nsl" data-action="connect" data-provider="facebook">
<span class="nsl-button nsl-button-default nsl-button-facebook" style="background-color:#4267b2;">
<svg xmlns="http://www.w3.org/2000/svg">
<path fill="#fff"></path>
</svg>
<span>Continue with <b>Facebook</b></span>
</span>
</a>
<a href="***?loginSocial=google" rel="nofollow" aria-label="Continue with <b>Google</b>" data-plugin="nsl" data-action="connect" data-provider="google">