Skip to content

Instantly share code, notes, and snippets.

View x3r0s's full-sized avatar
🏠
Working from home

David Kim x3r0s

🏠
Working from home
View GitHub Profile
@x3r0s
x3r0s / 1inchAPIComment.js
Last active July 14, 2022 09:37
TDI 프로젝트 Web3 1inch API 예제 코드에 설명 주석을 추가한 JS 문서입니다.
// 모듈 Import, 실제 사용에서는 fetch, yesno 모듈은 제거되며 Web3 Module은 etherjs 모듈로 Migration 됨
// Migration 방법에 관련된 문서는 https://docs.ethers.io/v5/migration/web3/ 참고
const Web3 = require('web3'); // Migration to etherjs
const fetch = require('node-fetch'); // Migration to Axios
// 네트워크 체인 ID 설정
const chainId = 56;
// Web3 RPC URL 설정, 추후 web3 provider에 인자로 들어감
const web3RpcUrl = 'https://bsc-dataseed.binance.org';
@x3r0s
x3r0s / Next.js-Responsive-Image.js
Created May 3, 2022 01:57
Next.js <Image> & tailwind 반응형 이미지 제공하는 방법
import Image from 'next/image'
<div>
<div className="md:hidden">
<Image src="Banner-767x500.webp" height={500} width={767} />
</div>
<div className="hidden md:inline-flex lg:hidden">
<Image src="Banner-1023x500.webp" height={500} width={1023} />
</div>
<div className="hidden lg:inline-flex xl:hidden">
@x3r0s
x3r0s / PM2-Command.md
Created February 8, 2022 16:53
PM2 Command

Change Process name

pm2 restart {id} --name {New name}

@x3r0s
x3r0s / shuffle.js
Created January 6, 2022 08:45
JavaScript Shuffle Prototype
// https://im-first-rate.tistory.com/35?category=827433
// Array의 prototype을 지정해주고, shuffle이라는 이름을 가진 함수를 생성
Array.prototype.shuffle = function () {
var length = this.length;
// 아래에서 length 후위 감소 연산자를 사용하면서 결국 0이된다.
// 프로그래밍에서 0은 false를 의미하기에 0이되면 종료.
while (length) {
@x3r0s
x3r0s / index.html
Created December 3, 2021 07:20
Search bar with search icon
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
@x3r0s
x3r0s / common.css
Last active December 3, 2021 07:19
no-drag.css
/* 글씨 드래그를 막아주는 css */
.no-drag {
-ms-user-select: none;
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
user-select: none;
}
@x3r0s
x3r0s / sharphr.css
Created November 24, 2021 08:41
sharp <hr> tag
hr {
border-width:1px 0px 0px 0px;
border-style:solid;
border-color:#808080;
opacity: 0.3;
height:1px;
}
@x3r0s
x3r0s / noBlankBetweenImg.css
Created November 22, 2021 05:30
<img>, <br> 태그 여백 제거 css
.target li br {
content: "";
display: block;
margin-bottom: -4px;
}
.target li img{
width:100%;
border:0;
}
@x3r0s
x3r0s / gl-Material-icons.html
Created November 22, 2021 01:21
Google Material Icons
<link href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp" rel="stylesheet">
<!-- import any icon from here -->
<!-- https://fonts.google.com/icons -->
<span class="material-icons-outlined">done</span>
@x3r0s
x3r0s / center.css
Last active December 14, 2021 04:32
center css
/* 부모 밑의 자식 div를 부모의 전체넓이를 기준으로 중앙정렬 할 때 */
.target {
position: relative;
top: 50%;
left: 50%;
margin: 0 0 0 -480px;
width: 960px;
}
/* 콘텐츠 컨테이너 영역을 정렬할 때 사용함 */