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
// Disable anchor links | |
window.addEventListener("click", function (event) { | |
event.preventDefault(); | |
}); | |
// Disable click eventlisteners | |
window.addEventListener("click", function (event) { | |
event.stopPropagation(); | |
}, true); | |
// design mode on | |
document.designMode = "on"; |
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
049e0cd87735e5682ccd20f6017e7d72e540eda8fe0344d3a5d24c6f37ab692952d678dfa729069abcd475de9321354639f1ea6c6e57c21c2a9d493fb50fdf5832;callmejimmyj |
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
# Update refs to .example.com | |
sudo su | |
openssl req -x509 -nodes -sha256 -days 3650 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -new -out /etc/apache2/ssl/apache.crt -subj /C=GB/ST=London/L=London/O="Company Name"/OU=Team/CN=www.example.com -reqexts SAN -extensions SAN -config <(cat /usr/lib/ssl/openssl.cnf <(printf '[ SAN ]\nsubjectAltName=DNS:www.example.com,DNS:example.com,DNS:*.example.com')) | |
exit | |
sudo service apache2 restart | |
# On Windows, trust the certificate: save the new certificate from Chrome to desktop (via Devtools > Security > View > Details > Copy to file; use DER option) | |
# May need to delete any previously imported certificates via mmc (on Windows) | |
# Run mmc; add the Certificates snap-in; import from desktop to 'Trusted Roots Certification Authorities' and also 'Other People' | |
# May need to clear Chrome history + SSLs (Settings > Network > Change proxy settings... > Content > Clear SSL state) |
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
<!DOCTYPE html> | |
<html lang="en" class="js"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Responsive text sizes</title> | |
<style> | |
h1 {font-size: 1.6em;} | |
p {font-size: 1em;} |
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
function wp_get_categories( $args = '' ) { | |
$defaults = array( | |
'show_option_all' => '', 'show_option_none' => __('No categories'), | |
'orderby' => 'name', 'order' => 'ASC', | |
'style' => 'list', | |
'show_count' => 0, 'hide_empty' => 1, | |
'use_desc_for_title' => 1, 'child_of' => 0, | |
'feed' => '', 'feed_type' => '', | |
'feed_image' => '', 'exclude' => '', | |
'exclude_tree' => '', 'current_category' => 0, |
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
# For Functions.php | |
// DIV SHORTCODE. Usage: [div id="ID" class="CLASS"]xxxx[/div] | |
function createDiv($atts, $content = null) { | |
extract(shortcode_atts(array( | |
'id' => "", | |
'class' => "", | |
), $atts)); | |
return '<div id="'. $id . '" class="'. $class . '" />' . $content . '</div>'; | |
} | |
add_shortcode('div', 'createDiv'); |
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
// Fade in divs consecutively (optional delay) | |
var delayBetweenEach = 300; | |
var fadeSpeed = 400; | |
$(".myDiv").delay(1000).each(function(index) {$(this).delay(delayBetweenEach*index).fadeIn(fadeSpeed);}); |
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
// Using Modernizr to detect mobile in this case. More specific for iOS may be better. | |
var event = (Modernizr.touch) ? "touchstart" : "click"; | |
$("#element").bind(event, function(e) { | |
// do it | |
} |
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
function twitterify($ret) { | |
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); | |
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r< ]*)#", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); | |
$ret = preg_replace("/@(\w+)/", "<a href=\"http://www.twitter.com/\\1\" target=\"_blank\">@\\1</a>", $ret); | |
$ret = preg_replace("/#(\w+)/", "<a href=\"http://search.twitter.com/search?q=\\1\" target=\"_blank\">#\\1</a>", $ret); | |
return $ret; | |
} | |
#Thanks: http://www.snipe.net/2009/09/php-twitter-clickable-links/ |
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 | |
function get_tag_id_by_name($tag_name) { | |
global $wpdb; | |
$tag_ID = $wpdb->get_var("SELECT * FROM ".$wpdb->terms." WHERE `name` = '".$tag_name."'"); | |
return $tag_ID; | |
} | |
?> |
NewerOlder