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 customize_query ( $query ) { | |
// Make sure this is only effecting the public side | |
if ( ! is_admin() ) : | |
// Make sure this is a query for the post page and is the main query for the page | |
if ( is_home() && $query->is_main_query() ) : | |
// Set query to only pull posts from the specified category | |
$query->set( 'category_name', 'Newsletter' ); | |
endif; | |
endif; |
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
Role Menu Editor | |
Loading Page | |
success -> Edit Role | |
permission failure -> Load Error | |
nonce failure -> Load Error | |
data failure -> Load Error | |
network failure -> Load Error | |
missing role failure -> Load Error | |
Edit Role | |
change role -> Loading Page |
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 error I am getting: | |
-- NAMING ERROR ----------------- /Users/wking/sites/elm-pair/tests/PairSpec.elm | |
I cannot find a `Pair.from` variable: | |
17| Pair.from 0 randomMaybe | |
^^^^^^^^^ | |
The `Pair` module does not expose a `from` variable. These names seem close | |
though: |
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
// Main function w/helpers for readibility | |
const generateKeyframes = total => frames => | |
Array | |
.from({ length: total }) | |
.reduce((acc, _, i) => | |
ifElse( | |
hasFrame(frames), | |
makeKeyframe(total, frames, acc), | |
always(acc) | |
)(i) |
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
import React from 'react' | |
import PropTypes from 'prop-types' | |
class ElmHandler extends React.Component { | |
node = React.createRef() | |
/** | |
* Setup the Elm app using the ref for this components node | |
* using the flags passed in as props. Connect the port handler | |
* function passed in from props to the ports established in the |
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
// Set base multiplier for use with rem units | |
html { font-size: 4px } | |
// Set body back to default size | |
body { font-size: 4rem } | |
// Add spacing to elements without worrying if vertical rythm matches the scale | |
h1 { margin: 0 0 10rem 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
const Right = v => ({ | |
chain: f => f(v), | |
map: f => Right(f(v)), | |
fold: (f, g) => g(v), | |
}); | |
const Left = v => ({ | |
chain: f => f(v), | |
map: f => Left(f(v)), | |
fold: (f, g) => f(v), |
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
import transformSibs from 'transform-sibs'; | |
// Use a curried function to pass more arguments to callback | |
const removeClass = className => el => el.classList.remove(className); | |
// get element from DOM | |
const $item = document.querySelector('.item'); | |
// Transform all siblings of $item and remove class 'active' | |
transformSibs($item, removeClass('active')); |
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
const transformSibs = (el, callback) => Array | |
.from(el.parentNode.childNodes) | |
.filter(child => child.nodeType == 1 && child != el) | |
.forEach(sibling => { | |
callback(sibling); | |
return sibling; | |
}); |