Skip to content

Instantly share code, notes, and snippets.

View KZeni's full-sized avatar

Kurt Zenisek KZeni

View GitHub Profile
@KZeni
KZeni / smartWebBanner-example-full.js
Last active August 29, 2015 13:57
Smart Web App Banner Example (with full options)
$().smartWebBanner({
title: "Website Name", // What the title of the "app" should be in the banner | Default: "Web App"
titleSwap: true, // Whether or not to use the title specified here has the default label of the home screen icon (otherwise uses the page's <title> tag) | Default: true
url: '/', // URL to mask the page as before saving to home screen (allows for having it save the homepage of a site no matter what page the visitor is on) | Default: ""
author: "Company Name", // What the author of the "app" should be in the banner | Default: "Save to Home Screen"
speedIn: 300, // Show animation speed of the banner | Default: 300
speedOut: 400, // Close animation speed of the banner | Default: 400
useIcon: true, // Whether or not it should show site's apple touch icon (located via <link> tag) | Default: true
iconOverwrite: "http://other-url.com/icon-512x512.png", // Force the URL of the icon (even if found via <link> tag) | Default: ""
iconGloss: "auto", // Whether or not to show the gloss over the i
@KZeni
KZeni / smartWebBanner-example-defaults.js
Created March 17, 2014 19:13
Smart Web App Banner Example (using default settings)
$().smartWebBanner();
@KZeni
KZeni / jquery-html5-file-upload.php
Created April 3, 2014 01:14
Swap the jqhfu_enqueue_scripts() function out (found in jquery-html5-file-upload.php) with this new one to get https://wordpress.org/plugins/jquery-html5-file-upload/ working as of version 1.3 of that WordPress plugin.
function jqhfu_enqueue_scripts() {
$stylepath=JQHFUPLUGINDIRURL.'css/';
$scriptpath=JQHFUPLUGINDIRURL.'js/';
wp_enqueue_style ( 'jquery-ui-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/jquery-ui.css' );
wp_enqueue_style ( 'jquery-image-gallery-style', '//blueimp.github.io/Gallery/css/blueimp-gallery.min.css');
wp_enqueue_style ( 'jquery-fileupload-ui-style', $stylepath . 'jquery.fileupload-ui.css');
wp_enqueue_script ( 'enable-html5-script', '//html5shim.googlecode.com/svn/trunk/html5.js');
if(!wp_script_is('jquery')) {
wp_enqueue_script ( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js',array(),'',false);
@KZeni
KZeni / tabby.css
Last active August 29, 2015 14:10
Tabby Responsive Tabs (Add Browser History Support)
/* ------ wordpress.org/plugins/tabby-responsive-tabs/ ------ */
.responsive-tabs .responsive-tabs__heading {
display: none;
}
.responsive-tabs .responsive-tabs__list__item {
display: inline;
cursor: pointer;
}
@KZeni
KZeni / adrotate-cookie.php
Created December 4, 2014 21:33
Fix JavaScript error when visitors are using an Ad Blocker
@KZeni
KZeni / getting-started.md
Last active August 29, 2015 14:15
Beginner's Getting Started Guide for jQuery Smart Web App Banner

1. Add jQuery by adding the following to the <head> of your page/site:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

Note: You don't need to add this if jQuery is already being called on the page.

2. Add the banner’s CSS by adding the following to the <head> of your page/site:

<link href="//cdnjs.cloudflare.com/ajax/libs/jquery-smart-web-app-banner/1.4/jquery.smartwebbanner.min.css" rel="stylesheet" type="text/css" />

3. Add the banner’s JavaScript by adding the following before the closing </body> tag (making it so it lets the main part of your site load first):

@KZeni
KZeni / functions.php
Created March 10, 2015 19:36
Auto-Activate WordPress Multi-Site/Network Users After Registration (disable activation)
// Auto-activate users after registration
function my_disable_activation( $user, $user_email, $key, $meta = '' ){
// Activate the user
$user_id = wpmu_activate_signup( $key );
wp_set_auth_cookie( $user_id, true, is_ssl() );
wp_redirect( /*redirect to */ site_url() );
exit;
}
add_filter( 'wpmu_signup_user_notification', 'my_disable_activation', 10, 4 );
@KZeni
KZeni / postcode_shipping.php
Created August 27, 2015 21:27
Updated Postcode Shipping plugin for WordPress that supports Shipping Multiple Addresses in one cart.
<?php
/**
* Plugin Name: Postcode Shipping
* Description: This plugin allows you to set a flat shipping rate per country or state or postcode per Quantity/Order on WooCommerce.
* Version: 2.1.2
@KZeni
KZeni / 2012-09-06_complete_comments_v1.1.sql
Created September 10, 2012 18:22
Updated ThinkUp migration script to fix "Syntax error or access violation: 1103 Incorrect table name" error.
--
-- Comment encoded_locations table
--
CREATE TABLE IF NOT EXISTS `tu_encoded_locations_1_1` (
id int(11) NOT NULL AUTO_INCREMENT COMMENT 'Internal unique ID.',
short_name varchar(255) NOT NULL COMMENT 'Short name of a location, such as NYC.',
full_name varchar(255) NOT NULL COMMENT 'Full name of location, such as New York, NY, USA.',
latlng varchar(50) NOT NULL COMMENT 'Latitude and longitude coordinates of a place, comma-delimited.',
PRIMARY KEY (id),
KEY short_name (short_name)
@KZeni
KZeni / index.html
Created September 10, 2012 23:40
Text effect animations
<html>
<body>
<p>fly in, fly out</p>
</body>
</html>