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 { ForwardedRef, MutableRefObject, useEffect, useRef } from 'react' | |
function useOuterRef(outerRef: ForwardedRef<HTMLElement | null>): MutableRefObject<HTMLElement | null> { | |
const innerRef = useRef<HTMLElement | null>(null) | |
useEffect(() => { | |
if (!outerRef) return | |
if (typeof outerRef === 'function') { | |
outerRef(innerRef.current) |
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 | |
namespace LargeJson; | |
class JSONEncoder { | |
protected static $whiteSpace = ' '; | |
protected static $indentation = 2; | |
protected static $inline = false; | |
/** |
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 | |
// NOTE: This filter has no effect on "Active Filters" widget | |
add_filter('woocommerce_layered_nav_link', function(string $link) { | |
static $shopPageId, $shopPermalink, $silent; | |
if (!isset($silent)) { | |
$silent = wp_get_environment_type() === 'production'; | |
} |
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
// @flow | |
export const stringListCombinationsWithoutSort = (a: string[], transformer: (str: string) => string): string[] => { | |
return a.reduce((accumulator, propName, i) => [ | |
propName, | |
...accumulator, | |
...(accumulator.map((s) => (s + (transformer ? transformer(propName) : propName)))), | |
], []) | |
} |
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
.remove-extra-line-height(@line-height: 1, @m-height: 0.7, @coef: 0.5) { | |
line-height: 1em * @line-height; | |
&:before, | |
&:after { | |
content: ""; | |
display: table; | |
} | |
&:before { |
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 (w, domains) { | |
'use strict'; | |
var to, | |
// Google SERP div#search | |
search, | |
// Array of links | |
links, | |
// Passed arg iterator | |
domainsI, | |
// Passed arg length |
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(domains) { | |
var to, | |
observer, | |
// Google SERP div#search | |
search, | |
// Array of links | |
links, | |
// Passed arg iterator | |
domainsI, | |
// Passed arg length |
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
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */ | |
// 1. Change the default font family in all browsers (opinionated). | |
// 2. Correct the line height in all browsers. | |
// 3. Prevent adjustments of font size after orientation changes in IE and iOS. | |
// Document | |
html { | |
font-family: sans-serif; // 1 |
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
/** | |
* Platform CSS class on HTML tag inspired by https://github.com/driftyco/ionic/blob/67ef9ebde21ac64e1f9e3db43b16c2db7ed2256d/js/utils/platform.js | |
*/ | |
(function(w, el) { | |
var platformName, | |
IOS = 'ios', | |
ANDROID = 'android', | |
WINDOWS_PHONE = 'windowsphone', | |
EDGE = 'edge', | |
CROSSWALK = 'crosswalk'; |
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
.wrapper .header, | |
.site-footer { | |
min-width: auto; | |
padding: 10px; | |
} | |
body .container { | |
max-width: 980px; | |
width: auto; | |
} |