Skip to content

Instantly share code, notes, and snippets.

View HyunSeob's full-sized avatar
😴
Lazy

HyunSeob HyunSeob

😴
Lazy
View GitHub Profile
@HyunSeob
HyunSeob / google.js
Last active July 11, 2019 10:27
Puppeteer & Jest: Describe "google.com"
const puppeteer = require('puppeteer');
const myAccount = require('../google-account.js');
jest.setTimeout(30000);
let browser = null;
let signContext = null;
beforeAll(async () => {
browser = await puppeteer.launch({ headless: false });
@HyunSeob
HyunSeob / .zshrc
Last active February 10, 2022 09:33
#### FIG ENV VARIABLES ####
# Please make sure this block is at the start of this file.
[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh
#### END FIG ENV VARIABLES ####
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/hyunseob/.oh-my-zsh"
@HyunSeob
HyunSeob / Brewfile
Created November 30, 2018 11:29
Brewfile
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "homebrew/services"
brew "autojump"
brew "bat"
brew "fzf"
brew "git-flow-avh"
import React from 'react'
namespace Form {
export interface Fields {
email: string;
password: string;
}
export interface Props {
onSubmit: (fields: Form.Fields) => void;
import React, { Component } from 'react'
enum ToastSize {
SMALL,
MEDIUM,
LARGE
}
enum ToastType {
INFO,
import React, { Component } from 'react';
import { render } from 'react-dom';
type Omit<T, U extends keyof T> = Pick<T, Exclude<keyof T, U>>
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
onClick: (value: ButtonHTMLAttributes<HTMLButtonElement>['value']) => void
}
class Button extends Component<ButtonProps> {
import React, { Component } from 'react';
import { render } from 'react-dom';
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {}
class Button extends Component<ButtonProps> {
handleClick = () => {
this.props.onClick(this.props.value) // Error!
}
import React from 'react';
import { render } from 'react-dom';
class Button extends React.Component {
handleClick = () => {
this.props.onClick(this.props.value)
}
render() {
return <button {...this.props} onClick={this.handleClick} />
import React, { StatelessComponent, ButtonHTMLAttributes } from 'react';
import { render } from 'react-dom';
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
color?: string
}
const Button: StatelessComponent<ButtonProps> = ({ color, children, ...props }) => (
<button style={{ color }} {...props}>{children}</button>
)
import React from 'react';
import { render } from 'react-dom';
const Button = ({ color, children, ...props }) => (
<button style={{ color }} {...props}>{children}</button>
)
render((
<div>
<Button color="red">Button1</Button>