This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('ninja_forms_display_js', 'dbushell__ninja_forms_display_js'); | |
add_action('ninja_forms_display_css', 'dbushell__ninja_forms_display_css'); | |
function dbushell__ninja_forms_display_js() | |
{ | |
if (is_admin()) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('click', '[data-href]', function(e) | |
{ | |
var t = e.target; | |
if (t && t.nodeType === 1 && t.nodeName.toLowerCase() === 'a') { | |
return; | |
} | |
window.location.href = $(e.currentTarget).data('href'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stylesheets = Array.prototype.slice.call(document.querySelectorAll('link[href*=".css"]')) | |
var sheets = document.styleSheets; | |
function pollSheets() { | |
var i, j, load_count = 0; | |
for (i = 0; i < stylesheets.length; i++) { | |
for (j = 0; j < sheets.length; j++) { | |
// check if stylesheet exists in document.styleSheets | |
if (sheets[j].href && sheets[j].href.indexOf( stylesheets[i].href ) > -1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
cheerio = require('cheerio'), | |
express = require('express'); | |
module.exports = plugin; | |
function plugin(grunt) | |
{ | |
grunt.registerTask('dbushell_server', 'dbushell.com', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var div = $('<div/>'); | |
function encodeEntities(str) { | |
return div.text(str).html(); | |
} | |
function decodeEntities(str) { | |
return div.html(str).text(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Modernizr.touch) { | |
var hero = $('#hero'); | |
var touchCancel = function() | |
{ | |
hero[0].removeEventListener('touchmove', touchMove, false); | |
hero[0].data('touch', false); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Diagonal Stripe Background with CSS and SVG | |
*/ | |
body { | |
padding: 0; | |
margin: 0; | |
} | |
#content { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* requires jQuery | |
* usage: | |
* Scroller.to({ offset: 100 }); | |
* Scroller.to({ target: $('#main') }); | |
* | |
* advanced usage (with additional easing function not provided here) | |
* Scroller.to({ target: $('#main'), delay: 500, multiplier: 1.5, easing: 'easeOutQuad' }); | |
*/ | |
var Scroller = (function() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add to functions.php in your WordPress theme | |
add_filter('upload_mimes', 'my_upload_mimes'); | |
function my_upload_mimes($mimes = array()) | |
{ | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Easy steps for cloning a live WordPress site for local development with MAMP. Am I missing anything? | |
1. add new MAMP server | |
2. download all files | |
3. export MySQL database | |
4. import SQL to MAMP via command line: | |
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -p dbname < ~/Downloads/database.sql | |
5. update: wp-config.php |
OlderNewer