Skip to content

Instantly share code, notes, and snippets.

View kylebebak's full-sized avatar

Kyle Bebak kylebebak

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kylebebak on github.
  • I am kylebebak (https://keybase.io/kylebebak) on keybase.
  • I have a public key whose fingerprint is 4200 B2E2 B69F 9E45 688B 5EF1 4170 6FCA FA75 227D

To claim this, I am signing this object:

@kylebebak
kylebebak / debounce.py
Last active August 30, 2023 12:46
Simple Python 3 debounce implementation
"""
@debounce(3)
def hi(name):
print('hi {}'.format(name))
hi('dude')
time.sleep(1)
hi('mike')
time.sleep(1)
import Dropzone from 'react-dropzone-uploader'
const Uploader = () => {
return (
<Dropzone
getUploadParams={() => ({ url: 'https://mybucket.s3.amazonaws.com' })} // specify upload params and url for your files
onChangeStatus={({ meta, file }, status) => { console.log(status, meta, file) }}
onSubmit={(files) => { saveFileUrlsToMyServer(files) }} // e.g., submit the uploaded file URLs to your backend
accept="image/*,audio/*,video/*"
/>
const DropzoneWithPreview = () => {
return (
<Dropzone
getUploadParams={() => ({ url: 'https://httpbin.org/post' })}
onChangeStatus={({ remove }, status) => { if (status === 'headers_received') remove() }}
accept="image/*,audio/*,video/*"
/>
)
}
const thumbsContainer = {
display: 'flex',
flexDirection: 'row',
flexWrap: 'wrap',
marginTop: 16
}
const thumb = {
display: 'inline-flex',
borderRadius: 2,