Tiny wrapper component for React-Datepicker to stylistically fit with Chakra-UI 1.x.
<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} />
Tiny wrapper component for React-Datepicker to stylistically fit with Chakra-UI 1.x.
<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} />
const fsPromises = require('fs').promises; | |
const path = require('path'); | |
/** | |
* Recursively removes empty directories from the given directory. | |
* | |
* If the directory itself is empty, it is also removed. | |
* | |
* Code taken from: https://gist.github.com/jakub-g/5903dc7e4028133704a4 | |
* |
<template> | |
<!-- WYSIWYG Editor --> | |
<div class="editor mb-4"> | |
<editor-menu-bar class="editor-bar" :editor="editor"> | |
<div slot-scope="{ commands, isActive, focused, getMarkAttrs }"> | |
<!-- Image --> | |
<label | |
class="btn btn-plain mb-0" | |
:class="{ 'is-loading': isUploading }" | |
v-tooltip="'Add Image'"> |
kernel /bzimage | |
append | |
isolcpus=2-7,10-15 | |
pcie_acs_override=downstream,multifunction | |
pci-stub.ids=14e4:43a0 | |
vfio-pci.ids=8086:a348,10de:10f8,10de:1ad8,1b73:1100,8086:24f3,14e4:43a0 | |
pci=noaer | |
modprobe.blacklist=amdgpu,wl,bluetooth,b43 | |
kvm.ignore_msrs=1 | |
vfio_iommu_type1.allow_unsafe_interrupts=1 |
FROM i386/alpine:3.10.2 | |
# Wine 32Bit for running EXE | |
RUN apk add --no-cache wine=3.0.4-r1 freetype=2.10.0-r0 | |
# Configure Wine | |
RUN winecfg | |
# Install wget | |
RUN apk add --no-cache wget=1.20.3-r0 |
import React, { useEffect, useRef } from "react"; | |
import { withRouter } from 'react-router-dom'; | |
function usePrevious(value) { | |
const ref = useRef(); | |
useEffect(() => { | |
ref.current = value; |
If you use server rendering, keep in mind that neither useLayoutEffect
nor useEffect
can run until the JavaScript is downloaded.
You might see a warning if you try to useLayoutEffect
on the server. Here's two common ways to fix it.
If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect
instead.
function MyComponent() {
import cv2 | |
import numpy as np | |
def deskew(im, max_skew=10): | |
height, width = im.shape | |
# Create a grayscale image and denoise it | |
im_gs = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) | |
im_gs = cv2.fastNlMeansDenoising(im_gs, h=3) |
const input = require('./spec3.json') | |
function titleCase(snake) { | |
return snake.replace(/(^|_)([a-z])/g, (s) => s.replace('_', '').toUpperCase()) | |
} | |
function isPrimitive(schema) { | |
switch (schema.type) { | |
case 'boolean': | |
case 'number': |
import { FieldProps } from 'formik' | |
import React from 'react' | |
import Select, { Option, ReactSelectProps } from 'react-select' | |
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({ | |
options, | |
field, | |
form, | |
}) => ( | |
<Select |