Skip to content

Instantly share code, notes, and snippets.

View sbin0819's full-sized avatar
:octocat:
Working from home

sbin sbin0819

:octocat:
Working from home
View GitHub Profile
grep -v master // master 제외
<!-- local branch 삭제 패턴 -->
```bash
git branch | grep "" | grep -v master | xargs git branch -D
```
<!-- remote branch 삭제 패턴 -->
```bash
```ts
import { render as renderComponent } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
export const render = (
ui: React.ReactElement,
options?: Parameters<typeof renderComponent>[1],
) => {
const user = userEvent.setup();
const result = renderComponent(ui, options);
const useInterval = (callback: Function, delay?: number | null) => {
  const savedCallback = useRef<Function>(() => {});

  useEffect(() => {
    savedCallback.current = callback;
  });

  useEffect(() => {
 if (delay !== null) {
body {
...
overscroll-behavior: none; < = overscroll 바운스 액션 막아줌
}
const personProxy = new Proxy(person, {
  get: (obj, prop) => {
    if (!obj[prop]) {
      console.log(
        `Hmm.. this property doesn't seem to exist on the target object`
      );
    } else {
      console.log(`The value of ${prop} is ${obj[prop]}`);
 }
useEffect(() => {
  const sse = new EventSource('[YOUR_SSE_ENDPOINT_URL]',
    { withCredentials: true });
  function getRealtimeData(data) {
    // process the data here,
    // then pass it to state to be rendered
  }
  sse.onmessage = e => getRealtimeData(JSON.parse(e.data));
 sse.onerror = () =&gt; {
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheet } from 'styled-components';

export default class MyDocument extends Document {
  static async getInitialProps(ctx: any) {
    const { renderPage } = ctx;
    const initialProps = await Document.getInitialProps(ctx);

 const sheet = new ServerStyleSheet();
  • 컨테이너 생성
docker create [image]
  • 컨테이너 시작
import {Platform, PermissionsAndroid} from 'react-native';
import {
  launchCamera,
  launchImageLibrary,
  ImagePickerResponse,
} from 'react-native-image-picker';

export const onHandleCamera = async () => {
  if (Platform.OS === 'android') {