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
import React from 'react'; | |
// This allows us to apply the typings of one component to another without | |
// having to maintain interfaces or types manually. | |
export type ExtractProps<T> = T extends React.ComponentType<infer P> ? P : T; | |
// This can be used to maintain behavior from the original component on our | |
// library customized version. For example. if we want to customize parts of | |
// HeadlessUI -- we could repackage their components with preserved types | |
// and props - like so... |
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
modules.export = { | |
// == Typography & Themes ============== | |
"workbench.colorTheme": "Ayu Mirage", | |
"editor.fontFamily": "MonoLisa, Operator Mono Lig, MonoLisa, Menlo", | |
"editor.fontSize": 16, | |
"editor.lineHeight": 24, | |
"editor.letterSpacing": -0.1, | |
"editor.fontWeight": 300, | |
"editor.fontLigatures": true, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script> | |
<script src="https://fb.me/react-with-addons-15.1.0.js"></script> |
This is a sample of the entire payload provided to the front end. We are only able to parse data included in this object. Anything not included in this object MUST be a backend story.
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
import React, { useRef } from 'react' | |
import useOnClickOutside from './useOnClickOutside' | |
export default function Component() { | |
// Set a ref for the handler to use | |
const ref = useRef(null) | |
// Handler for outside clicks here | |
const handleClickOutside = () => { | |
// Your custom logic here |
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
{ | |
"extends": [ | |
"airbnb", | |
"prettier", | |
"prettier/react" | |
], | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 2018, | |
"ecmaFeatures": { |
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
// convert 0..255 R,G,B values to binary string | |
RGBToBin = function(r,g,b){ | |
var bin = r << 16 | g << 8 | b; | |
return (function(h){ | |
return new Array(25-h.length).join("0")+h | |
})(bin.toString(2)) | |
} | |
// convert 0..255 R,G,B values to a hexidecimal color string | |
RGBToHex = function(r,g,b){ |
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
<?php | |
$css = "style=''"; | |
if ( has_post_thumbnail( get_the_ID ) ) : | |
$size = 'large'; // choose size of image to be used | |
$thumb_id = get_post_thumbnail_id(); | |
$thumb_object = wp_get_attachment_image_src($thumb_id, $size, true); | |
$thumb_url = $thumb_object[0]; | |
$css = "background-image:url('$thumb_url'); background-size:cover; background-position:top-center no-repeat;" | |
endif; |
NewerOlder