Skip to content

Instantly share code, notes, and snippets.

View CoryDuncan's full-sized avatar
🖤

Cory Duncan CoryDuncan

🖤
View GitHub Profile

Keybase proof

I hereby claim:

  • I am coryduncan on github.
  • I am coryduncan (https://keybase.io/coryduncan) on keybase.
  • I have a public key ASDKxvdgvzsnXsO_bmnndvbQTVAucVQvym9GP6F8rZvHJQo

To claim this, I am signing this object:

@CoryDuncan
CoryDuncan / index.html
Created March 12, 2015 21:14
Bounce Spinner
<!DOCTYPE html>
<html>
<head>
<title>Spinner</title>
<style>
.loader {
background: #fff;
height: 100%;
opacity: 1;
position: fixed;
@CoryDuncan
CoryDuncan / gist:714e67b2c7be048bd4a1
Created October 20, 2014 18:09
Simple nav menu toggle
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Nav Toggle</title>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
</head>
<body>
<nav id="nav">
<a href="#nav-menu" id="nav-toggle">Nav Menu</a>
@CoryDuncan
CoryDuncan / jQuery.support.flash
Last active December 16, 2015 16:19
Extends jQuery.support to check for flash support
$.support.flash = (function() {
var isSupported = false;
if (window.ActiveXObject) {
try {
new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
isSupported = true;
} catch ( e ) {
isSupported = false;
@CoryDuncan
CoryDuncan / obfuscate_email()
Last active December 16, 2015 02:59
PHP function to obfuscate an email address
/**
* Obfuscate an email address
*
* @param string {$email} email address
* @param boolean {$isLink} create mailto link or not
*
* @return string
*
*/
function obfuscate_email( $email, $isLink = FALSE ) {
@CoryDuncan
CoryDuncan / jQuery.scrollSticky
Last active June 29, 2017 13:43
Simple jQuery plugin to emulate position: sticky
/******************************************************************************
* jQuery.fn.scrollSticky
* Applies a UI state class to an element when the user scrolls to it. Works well
* for fixed positioning UI that is dependent on scroll
*******************************************************************************/
$.fn.scrollSticky = function ( options ) {
var methods = {
init: function() {
return this.each(function ( index ) {
var $item = $( this ),