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, { useReducer } from 'react' | |
import hoistNonReactStatics from 'hoist-non-react-statics' | |
interface Reducer { | |
(state, action): any | |
hook | |
host | |
} | |
function reducerx(isProvide: boolean, ...reducers: Reducer[]) { |
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
" vim-plug | |
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
" :PlugInstall :PlugUpdate :PlugClean :PlugUpgrade | |
let &pythonthreedll = '/opt/homebrew/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/libpython3.11.dylib' | |
call plug#begin() | |
Plug 'joshdick/onedark.vim' | |
Plug 'scrooloose/nerdtree' | |
Plug 'ap/vim-buftabline' |
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
const rdot = /\.(\d*)$/ | |
const rleadzero = /^0+/ | |
function toIntStr(number) { | |
let string = number.toString() | |
let exponent = 0 | |
string = string | |
.replace(rdot, (str, p) => { | |
exponent = p.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
/* | |
MDC on encodeURIComponent(): | |
literal characters (regex representation): [-a-zA-Z0-9._*~'()!] | |
Java 1.5.0 documentation on URLEncoder: | |
literal characters (regex representation): [-a-zA-Z0-9._*] | |
the space character " " is converted into a plus sign "+". | |
*/ |
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
font-face(filename) | |
@font-face | |
font-family basename(filename) | |
src url(filename + '.woff') format('woff') | |
font-weight normal | |
font-style normal | |
[data-icon]::before | |
/* use !important to prevent issues with browser extensions that change fonts */ | |
font-family basename(filename) !important |
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 proxy(context, target, assert) { | |
let queue = [] | |
function send(methodName, ...methodArguments) { | |
const object = context[target] | |
if (object && eval(assert)) { | |
object[methodName](...methodArguments) | |
} | |
else { | |
queue.push({methodName, methodArguments}) |
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 () { | |
var scale = 1 / window.devicePixelRatio; | |
document.querySelector('meta[name=viewport]').setAttribute('content', 'width=device-width,initial-scale='+scale+',maximum-scale='+scale+',minimum-scale='+scale+',user-scalable=no'); | |
var rangingRem = document.createElement('div'); | |
rangingRem.style.cssText = 'width:1rem;'; | |
document.head.appendChild(rangingRem); | |
var defaultFontSize = parseFloat(getComputedStyle(rangingRem).getPropertyValue('width'), 10); | |
document.head.removeChild(rangingRem); | |
var uiWidth = parseInt(document.querySelector('meta[itemprop=uw]').getAttribute('content'), 10); | |
document.documentElement.style.fontSize = document.documentElement.clientWidth * 100 / uiWidth / defaultFontSize * 100 + '%'; |
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 loadScripts(assets, nostore) { | |
if (!('async' in document.createElement('script'))) { | |
assets.forEach(function (asset) { | |
document.write('<script src="' + asset.url + '"><\/script>'); | |
}); | |
return; | |
} | |
if (!nostore) { | |
var valid = assets.every(function (asset) { |