Skip to content

Instantly share code, notes, and snippets.

Nathan Burkiewicz N8-B

Block or report user

Report or block N8-B

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View remove-diacritics.js
var defaultDiacriticsRemovalMap = [
{'base':'A', 'letters':'\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F'},
{'base':'AA','letters':'\uA732'},
{'base':'AE','letters':'\u00C6\u01FC\u01E2'},
{'base':'AO','letters':'\uA734'},
{'base':'AU','letters':'\uA736'},
{'base':'AV','letters':'\uA738\uA73A'},
{'base':'AY','letters':'\uA73C'},
{'base':'B', 'letters':'\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181'},
{'base':'C', 'letters':'\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E'},
@N8-B
N8-B / padLeft.js
Last active Jun 18, 2016
padLeft - Function for padding strings on the left side
View padLeft.js
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars='0'] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
@N8-B
N8-B / gulpfile.js
Last active Mar 11, 2018
Gulp tasks for my Harp configuration and workflow. Automates, server, build and publish tasks.
View gulpfile.js
var gulp = require('gulp');
var harp = require('harp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var deploy = require('gulp-gh-pages');
var cp = require('child_process');
var clean = require('gulp-rimraf');
/**
* Serve the Harp Site
@N8-B
N8-B / WPDM-login-fix.php
Last active Sep 4, 2015
Login Fix for Wordpress Download Manager
View WPDM-login-fix.php
/**
* WooCommerce Account Page Login Fix for Wordpress Download Manager.
* Prevents wpdm_login hook from loading and fixes the conflict with WooCommerce login.
* Add this code to the functions.php file
**/
<?php
add_action('plugins_loaded','remove_wpdm_hook');
View atomConfig
// Atom.io Synch Settings
@N8-B
N8-B / xhr-ie6.js
Last active Aug 29, 2015
XMLHttpRequest in IE6
View xhr-ie6.js
// An alternative implementation to the createXHR function for creating
// an XHR object in all modern browsers as well as emulating IE5 and IE6.
if (window.XMLHttpRequest === undefined) {
window.XMLHttpRequest = function() {
try {
// Use the latest version of the ActiveX object if available
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
}
catch(e1) {
@N8-B
N8-B / createXHR.js
Last active Aug 29, 2015
Create XHR function
View createXHR.js
// Function for creating an XHR object which is compatible in all browsers.
// This implementation is compatible with the original Internet Explorer version.
// So, it can be used to create an XHR object in any browser.
// Example usage:
// var xhr = createXHR();
// xhr.onreadystatechange = function() {
// if(xhr.readyState == 4) {
// if((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {
// alert(xhr.responseText);
// } else {
@N8-B
N8-B / gist:4353531
Created Dec 21, 2012
Amazon s3 Bucket Policy for preventing hotlinking. Yes!
View gist:4353531
{
"Version": "2008-10-17",
"Id": "0c762de8-f56b-488d-a4a4-20d1cb31df2f",
"Statement": [
{
"Sid": "Allow in my domains",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@N8-B
N8-B / html5_template.html
Created Sep 30, 2012 — forked from KennetPL/html5_template.html
HTML: Starting template
View html5_template.html
<!doctype html><!-- simplified doctype works for all previous versions of HTML as well -->
<!-- Paul Irish's technique for targeting IE, modified to only target IE6, applied to the html element instead of body -->
<!--[if lt IE 7 ]><html lang="en" class="no-js ie6"><![endif]-->
<!--[if (gt IE 6)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
<head>
<!-- simplified character encoding -->
<meta charset="utf-8">
You can’t perform that action at this time.