This is a collection of my most often used lines of code, as well as a few other examples I want to have ready at a moment's notice. These snippets focus on building HTML from scratch, linking in good web fonts, and setting up responsive styles for your pages.
This file contains hidden or 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
data-personas | |
data-default="<?php $dd = get_field_escaped($field); echo $dd; ?>" | |
<?php | |
$field = 'YourTagGoesHere'; | |
if(get_field($field . '_mm')) { | |
$mm = get_field_escaped($field . '_mm'); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} else { | |
$mm = get_field_escaped($field); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} | |
if(get_field($field . '_tt')) { |
This file contains hidden or 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() { | |
if (typeof EQCSS === 'undefined') { | |
var eq = document.createElement('script'); | |
eq.src = 'http://elementqueries.com/EQCSS.js'; | |
document.body.appendChild(eq); | |
}; | |
var myWidget = document.createElement('section'), | |
widgetStyles = document.createElement('script'), | |
tag = document.querySelectorAll('[src*=\'myWidget\']')[0]; | |
myWidget.innerHTML = '\ |
This file contains hidden or 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() { | |
var myWidget = document.createElement('section'), | |
widgetStyles = document.createElement('style'), | |
tag = document.querySelectorAll('[src*="myWidget"]')[0]; | |
myWidget.innerHTML = '\ | |
<!-- Add your HTML here, with line-breaks escaped by a "\" backslash character. -->\ | |
<!-- (Don\'t forget: you can escape any character, like quotes, as well -->\ | |
Hello\ | |
'; | |
widgetStyles.innerHTML = '\ |
This file contains hidden or 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
# How to throttle the FCC to dial up modem speeds on your website using Apache. | |
# Ported from https://gist.github.com/kyledrake/e6046644115f185f7af0 | |
## The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
## | |
## Current known FCC address ranges: | |
## https://news.ycombinator.com/item?id=7716915 | |
## | |
## Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft |
This file contains hidden or 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
// Display placeholder="" text as tooltip for :focused, non-empty inputs | |
$('form input').blur(function() { | |
var inputVal = $(this).val(), | |
titleText = $(this).attr('placeholder'); | |
if ( inputVal != '' ) { | |
$(this).tooltip({ | |
title: titleText, | |
trigger: 'focus', | |
container: 'form' | |
}); |
This file contains hidden or 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
# | |
# https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet | |
# based on the RSnake original http://ha.ckers.org/xss.html | |
# Retrieved on 2013-11-20 | |
# Much of this wildly obsolete | |
# | |
# XSS Locator 2 | |
'';!--"<XSS>=&{()} |