Skip to content

Instantly share code, notes, and snippets.

View HyunSeob's full-sized avatar
😴
Lazy

HyunSeob HyunSeob

😴
Lazy
View GitHub Profile
@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 / velocity-react.d.ts
Created March 26, 2018 03:16
Type definition for velocity-react
// Type definitions for velocity-react v1.3.3
// Project: https://github.com/google-fabric/velocity-react
// Definitions by: HyunSeob <https://github.com/hyunseob>
/// <reference types="velocity-animate" />
declare module 'velocity-react' {
import * as React from 'react'
export interface VelocityComponentProps extends jquery.velocity.Options {
@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 });
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> {
@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';
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>
)