- URL targeting
- Variation redirects
- Variation code
- Audience
- Traffic allocation
- Goal(s)
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
// inert-unert.js: a quick utility for applying or removing the inert property | |
// - @scottjehl, @filamentgroup | |
// (note: inert support polyfill is still needed in some browsers) | |
// usage: | |
// when a modal element such as a dialog is active, | |
// this function will make unrelated elements inert, aiming to affect as few as possible | |
// example: inert( document.querySelector(".modal-open") ); | |
function inert( allButThisElement ){ | |
function inertSiblings( node ){ | |
if( node.parentNode ){ |
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
@pytest.fixture | |
def firefox_options(firefox_options): | |
firefox_options.log.level = 'trace' | |
return firefox_options |
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
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
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 Dialog = React.createClass({ | |
render: function() { | |
// 1) render nothing, this way the DOM diff will never try to do | |
// anything to it again, and we get a node to mess with | |
return React.DOM.div(); | |
}, | |
componentDidMount: function() { | |
// 2) do DOM lib stuff | |
this.node = this.getDOMNode(); |
There are two methods to use in order to flip CSS styles: interpolated properties and the flip() function.
- Interpolation should be used for any property which has a direction (e.g.
padding-left
,margin-right
,border-right
,left
, etc.) flip()
should be used for all other properties
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 findOrFallback(where, what, fallback) { | |
for(var | |
vendors = ['', 'webkit', 'moz', 'ms', 'o'], | |
first = what.charAt(0), | |
others = first.toUpperCase(), | |
suffix = what.slice(1), | |
i = 0, length = vendors.length, | |
current; | |
i < length; i++ | |
) { |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
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
// this is the least sucky way i could think of to | |
// detect and deal with a cross-browser impl of the page visibility api | |
// forks welcome. | |
function getHiddenProp(){ | |
var prefixes = ['webkit','moz','ms','o']; | |
if ('hidden' in document) return 'hidden'; | |
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 has3d(){ | |
if (!window.getComputedStyle) { | |
return false; | |
} | |
var el = document.createElement('p'), | |
has3d, | |
transforms = { | |
'webkitTransform':'-webkit-transform', | |
'OTransform':'-o-transform', |
NewerOlder