Skip to content

Instantly share code, notes, and snippets.

View JinsupJung's full-sized avatar
🎯
Focusing

JinsupJung

🎯
Focusing
View GitHub Profile
commit
branch : 하나의 커밋과 그 부모 커밋들을 포함하는 작업 내역
checkout
cherry-pick <commit> <commit2> <...>
reset HEAD~1
revert HEAD
rebase
merge
< Git 리베이스(Rebase) >
@JinsupJung
JinsupJung / readme.md
Created May 20, 2023 02:29
[깃허브 배지]
  • Adobe

- Adobe XD

- Adobe InDesign

- Adobe Photoshop

- Adobe Illustrator
@JinsupJung
JinsupJung / lib.css
Last active June 1, 2023 04:45
[CSS LIB] #CSS
// styles/index.js
const styles = {
innerWidth: '2xl:max-w-[1280px] w-full',
interWidth: 'lg:w-[80%] w-[100%]',
paddings: 'sm:p-16 xs:p-8 px-6 py-12',
yPaddings: 'sm:py-16 xs:py-8 py-12',
xPaddings: 'sm:px-16 px-6',
topPaddings: 'sm:pt-16 xs:pt-8 pt-12',
bottomPaddings: 'sm:pb-16 xs:pb-8 pb-12',
@JinsupJung
JinsupJung / sitemap.ts
Created May 15, 2023 11:16
[사이트맵 만드는 코드] #nextjs
type Post = {
userId: number
id: number
title: string
body: string
}
export default async function sitemap() {
const res = await fetch( "https://jsonplaceholder.typicode.com/posts")
const allPosts = (await res.json()) as Post[]
@JinsupJung
JinsupJung / fc.tsx
Last active May 15, 2023 11:16
[NextJS 코드템플릿] #snippet #FC #nextjs
import { FC } from 'react';
interface PageProps {
}
const page: FC<PageProps> = ({}) => {
return (<div>page</div> );
}
@JinsupJung
JinsupJung / style.css
Created May 4, 2023 06:56
[CSS flex 메뉴] #flex
body, ul, li {
margin:0;
padding:0;
list-style:none;
}
a {
color:inherit;
text-decoration:none;
}
@JinsupJung
JinsupJung / formik.js
Created April 26, 2023 02:03
[리액트 Validation Formik] #React
// 필드 레벨
import React from 'react';
import { Formik, Form, Field } from 'formik';
function validateEmail(value) {
let error;
if (!value) {
error = 'Required';
} else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)) {
error = 'Invalid email address';
@JinsupJung
JinsupJung / use-input.js
Last active April 26, 2023 02:01
[리액트 Validation Input hook] #React
import { useState } from 'react';
const useInput = (validateValue) => {
const [enteredValue, setEnteredValue] = useState('');
const [isTouched, setIsTouched] = useState(false);
const valueIsValid = validateValue(enteredValue);
const hasError = !valueIsValid && isTouched;
const valueChangeHandler = (event) => {
@JinsupJung
JinsupJung / useRef.js
Created April 22, 2023 07:25
[리액트 useRef] #React
import React, { useState, useRef } from "react";
import Card from "../UI/Card";
import Button from "../UI/Button";
import ErrorModal from "../UI/ErrorModal";
import Wrapper from "../Helpers/Wrapper";
import styles from "./UserInput.module.css";
const UserInput = (props) => {
const nameInputRef = useRef();
@JinsupJung
JinsupJung / Input.js
Created April 22, 2023 06:33
[리액트 Input forwardRef] #React
import React, { useRef, useImperativeHandle } from 'react';
import classes from './Input.module.css';
const Input = React.forwardRef((props, ref) => {
const inputRef = useRef();
const activate = () => {
inputRef.current.focus();
};