A Pen by Christopher James Curtin on CodePen.
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, { useEffect, useRef, useState } from "react" | |
export const VisualViewport = ({ | |
as: Element = "div", | |
children, | |
style = {}, | |
...props | |
}) => { | |
const ref = useRef (null) |
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
// @see: https://jsben.ch/cQk7m | |
// NOTE: `+val === +val` is like isNaN(val) but much faster, esp in Chrome... | |
// `+val` will convert a string containing a number into a number | |
// const isNumeric = (val) => (val && val.length || typeof val === 'number') && (+val === +val); | |
const isNumeric = (val) => ((val?.length || typeof val === 'number') && (+val === +val)) && !isNaN(parseFloat(val)) | |
isNumeric(12345678912345678912); | |
isNumeric('2'); | |
isNumeric('-32.2'); |
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
let pancakeSwapAbi = [{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"interna |
input Deviation_Length = 60;
input Deviate = 2;
input high_price = high;
def volumestdev = RelativeVolumeStDev(length = Deviation_Length);
def abovedev = volumestdev >= Deviate;
def belowdev = volumestdev <= Deviate;
def volumereplace = volume;
def increase = volume > volume[1];
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 animatedCanvasGradient = () => { | |
useEffect(() => { | |
animateCanvas('canvas') | |
}, []) | |
return ( | |
<canvas | |
id="canvas" | |
width="26" | |
height="26" | |
style={{ |
-
wp_posts
-
wp_postmeta
-
wp_termmeta
--- EXPORT the product cat image "post ids" (used for the rest of the import/) --- note: `meta_value` contains the wp_posts post IDs we will be using SELECT meta_value FROM wp_termmeta INNER JOIN wp_term_taxonomy ON wp_termmeta.term_id = wp_term_taxonomy.term_id WHERE wp_termmeta.meta_key LIKE 'thumbnail_id' AND wp_term_taxonomy.taxonomy LIKE 'product_cat';
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 curry(func) { | |
return function curried(...args) { | |
if (args.length >= func.length) { | |
return func.apply(this, args); | |
} else { | |
return function(...args2) { | |
return curried.apply(this, args.concat(args2)); | |
} | |
} | |
} |
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
<?php | |
/** | |
* Like get_template_part() put lets you pass args to the template file | |
* Args are available in the tempalte as $template_args array | |
* @param string filepart | |
* @param mixed wp_args style argument list | |
* @example hm_get_template_part( 'template_path', [ 'option' => 'value' ] ); ---> then in template: $template_args['option']; | |
*/ | |
function hm_get_template_part( $file, $template_args = array(), $cache_args = array() ) { |
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
BlobToJSONObject = (blob) => { | |
obj = {} | |
for (var prop in blob) { | |
obj[prop] = blob[prop] | |
} | |
return obj | |
} |
NewerOlder