- connect to media_dev:
$ ssh -i ~/Downloads/blend_keypair.pem [email protected]
- clean yarn cache:
$ yarn cache clean
- check connected android device:
$ adb devices
- build & run RN android on release version:
$ react-native run-android --variant=release
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 { useEffect, useState } from 'react' | |
import { useLocation, useNavigate } from 'react-router-dom' | |
export function useHashModal(hash: string) { | |
const location = useLocation() | |
const navigate = useNavigate() | |
const [isOpen, setIsOpen] = useState(location.hash === hash) | |
// 감시: 해시 바뀌면 열림/닫힘 상태 업데이트 | |
useEffect(() => { |
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 colorByDepthFromSelector() { | |
// 64개의 서로 다른 색상 생성 | |
function generateColors() { | |
const hues = [0, 30, 60, 120, 180, 210, 270, 300]; // red, orange, yellow, green, cyan, blue, purple, pink | |
const lightnessSteps = [95, 90, 85, 80, 75, 70, 65, 60]; // 밝기 조절 | |
const colors = []; | |
for (const h of hues) { | |
for (const l of lightnessSteps) { | |
colors.push(`hsl(${h}, 70%, ${l}%)`); |
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 dayDiff = 2 | |
const offsetMs = dayDiff * 24 * 60 * 60 * 1000; // 이틀 = 2일 * 24시간 * 60분 * 60초 * 1000ms | |
const futureTime = Date.now() + offsetMs; | |
const OriginalDate = Date; | |
class MockDate extends OriginalDate { | |
constructor(...args) { | |
if (args.length === 0) { | |
return new OriginalDate(futureTime); |
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
{ | |
"terminal.external.osxExec": "iTerm.app", | |
"terminal.integrated.fontFamily": "Hack", | |
"terminal.integrated.defaultProfile.osx": "zsh", | |
"editor.minimap.enabled": false, | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"typescript.preferences.quoteStyle": "single", | |
"javascript.preferences.quoteStyle": "single", | |
"editor.defaultFormatter": "esbenp.prettier-vscode", |
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
git branch | tr -s '\n' ' ' | tr -s '*' ' ' | xargs git branch -D |
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 likedVideoElements = document.querySelectorAll('ytd-playlist-video-renderer.ytd-playlist-video-list-renderer yt-icon.ytd-menu-renderer'); | |
for (let i=0; i<likedVideoElements.length; i++) { | |
setTimeout(() => { | |
likedVideoElements[i].click(); | |
setTimeout(() => { document.querySelectorAll('yt-formatted-string.ytd-menu-service-item-renderer')[3].click(); }, 200); | |
}, i * 500); | |
} |
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 numbers = [2, 5, 1, 3, 4]; | |
function asyncNumber (n) { | |
return new Promise((resolve, reject) => { resolve(n) }); | |
} | |
async function asyncSum (numbers) { | |
return numbers.reduce(async (prevSum, n) => { | |
const sum = await prevSum; | |
return asyncNumber(sum + n); |
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 obj = { | |
a: {id: 'aa', name: 'aaa', age: 1}, | |
b: {id: 'bb', name: 'bbb', age: 2}, | |
c: {id: 'cc', name: 'ccc', age: 3}, | |
} | |
// get object except 'age' property | |
const exceptAge = ({ age, ...rest }) => rest; | |
R.map(exceptAge, obj); |
NewerOlder