Skip to content

Instantly share code, notes, and snippets.

View ziponia's full-sized avatar
:octocat:
정체성 혼란

Kuby (커비!) ziponia

:octocat:
정체성 혼란
View GitHub Profile
@ziponia
ziponia / on-the-fly-image.js
Created August 21, 2022 14:54
AWS Cloudfront Lambda Function Image On-The-Fly Thumbnail
'use strict';
const querystring = require('querystring'); // Don't install.
const AWS = require('aws-sdk'); // Don't install.
const Sharp = require('sharp');
const DEFAULT_BUCKET = '<your default bucket name>';
const S3 = new AWS.S3({
region: 'ap-northeast-2'
/**
* https://developers.kakao.com/docs/latest/ko/kakaologin/rest-api#req-user-info
*/
export type DateTime = string
export type Gender = 'female' | 'male'
export type AgeRange =
| '1-9'
| '10-14'
| '15-19'
@ziponia
ziponia / ant-menu-with-next-router.jsx
Last active April 10, 2021 08:03
ant-menu-with-next-router
import React, { useState } from "react"
import { Menu } from "antd"
import Link, { useRouter } from "next/router"
const { SubMenu } = Menu
const LeftNavigation = () => {
const router = useRouter()
/**
@ziponia
ziponia / App.js
Created March 22, 2020 10:17
티스토리 로그인 예시
// src/App.js
import React, { Component } from "react";
import "./App.css";
import axios from "axios";
import { Route, Link, Switch } from "react-router-dom";
//import Home from './inc/home.js';//
//import Test from './inc/test.js';//
// import Head from "./inc/Head";
import { Head } from "./inc";
import UserList from "./components/user/UserList";
/* 이 클래스는 페이지 이동 기능을 구현하기 위해서 필요한 7가지 정보를 기억하고 만들어줄 클래스이다.
* 페이징 처리하기 ***************************************************
[이전] [1][2][3][4][5] [다음]
[이전] [6][7][8][9][10] [다음]
위의 모양을 만들기 위해서 반드시 알아야 할 정보
1. 현재 페이지
2. 총 데이터 개수
=> 위 2개는 반드시 누군가가 알려줘야 할 정보
3. 한 화면에 보여줄 목록의 개수 - 10개
4. 한 화면에서 이동 가능한 페이지 수
@ziponia
ziponia / pocketmonster.js
Last active March 2, 2020 13:24
Javascript OOP 샘플용 포켓몬스터 게임
function percent(number) {
const rend = Math.random();
return number * 0.01 > rend;
}
function Pocketmon(name, type) {
this.name = name;
this.type = type;
this.life = 100;
@ziponia
ziponia / nginx.conf
Created December 24, 2019 15:16
aws elasticbeanstalk config nginx with spring boot
# ${PROJECT_ROOT}/.ebextensions/nginx
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 32725;
events {
worker_connections 1024;
@ziponia
ziponia / webpack.config.js
Created December 4, 2019 15:24
webpack 의 모듈을 html 로 내보내기 위한 설정 샘플
const TerserWebpackPlugin = require("terser-webpack-plugin");
const path = require("path");
const isProduction = process.env.NODE_ENV === "production";
module.exports = {
mode: isProduction ? "production" : "development",
context: __dirname + "/src", // 모듈 파일 폴더
entry: {
@ziponia
ziponia / App.js
Created May 13, 2019 08:45
아래 코드는 App.js 를 class 형태로 변경하고 state 를 정의 한 값이다.
import React from "react"; // NodeJS 로 설치 한 React default 모듈을 임포트 한다.
import Header from "./Header"; // new
// App 컴포넌트 생성
// React 의 Component 객체를 상속 받는다.
class App extends React.Component {
// Component 객체의 생성자의서 Component 생성자에 현재 컴포넌트의 props 를 주입한다.
// 단순하게 말해, React 내부적으로 new Component(props) 를 사용 하기 위핸 생성자인 것이다.
constructor(props) {
super(props);
@ziponia
ziponia / App.js
Last active May 13, 2019 08:30
2-react-app header
import React from "react"; // NodeJS 로 설치 한 React default 모듈을 임포트 한다.
import Header from "./Header"; // new
// App 컴포넌트 생성
function App() {
return (
<div>
<Header /> {/* new */}
hello world
</div>