Skip to content

Instantly share code, notes, and snippets.

View minhoyooDEV's full-sized avatar
👋

myno minhoyooDEV

👋
  • Seoul, korea
  • 09:27 (UTC +09:00)
View GitHub Profile
@minhoyooDEV
minhoyooDEV / useIntersectionObserver.tsx
Last active June 10, 2024 04:31
a Intersection observer with debounced callback
import { useCallback, useEffect, useRef, useState } from 'react';
// debounce 함수는 주어진 함수가 특정 시간 동안 호출되지 않도록 합니다.
// The debounce function ensures that the provided function is not called repeatedly within the specified wait time.
function debounce<T extends (...args: any[]) => void>(
func: T,
wait: number,
): (...args: Parameters<T>) => void {
let timeout: ReturnType<typeof setTimeout> | null = null;
@minhoyooDEV
minhoyooDEV / s3Sync.sh
Created October 13, 2023 17:49 — forked from kellyrmilligan/s3Sync.sh
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@minhoyooDEV
minhoyooDEV / Code.gs
Created January 6, 2022 11:10 — forked from edwinlee/Code.gs
Sync a Google Sheets spreadsheet to a Firebase Realtime database
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
@minhoyooDEV
minhoyooDEV / AWS_S3_UPLOAD_LOCAL_FILES.js
Created May 22, 2018 15:54
upload local file with aws-sdk using node
//https://gist.github.com/kethinov/6658166
var AWS = require('aws-sdk'),
fs = require('fs'),
path = require('path');
// For dev purposes only
AWS.config.update({accessKeyId: '.', secretAccessKey: '..'});