Skip to content

Instantly share code, notes, and snippets.

Avatar

YOONBYEONGIN rpf5573

View GitHub Profile
View tsconfig.json
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs", // commonjs방식으로 module을 import한다
"moduleResolution": "node", // nodejs에서 사용하는 방식으로 module을 찾아서 import한다
"strict": true,
"noResolve": false, // Do not add triple-slash references or module import targets to the list of compiled files.
"jsx": "react",
"allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
"resolveJsonModule":true, // import {name as appName} from '../app.json'; 이걸 가능하게 해준다. 즉 json파일을 import할 수 있도록 만들어준다
View etc nginx site-available default file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
@rpf5573
rpf5573 / index.d.ts
Created Jun 2, 2019
react-native-voice type definition file
View index.d.ts
declare module "react-native-voice" {
type Locale = 'en-US' | 'ko-KR' | 'ja-JP' | 'zh-CN' | 'zh_HK' | 'zh'
type Option = {
EXTRA_LANGUAGE_MODEL: string,
EXTRA_MAX_RESULTS: number,
EXTRA_PARTIAL_RESULTS: boolean,
REQUEST_PERMISSIONS_AUTO: boolean
}
type StartEvent = {
error: boolean
View webpack.config.js
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const join = require('path').join;
module.exports = {
name: 'user',
entry: [join(__dirname, '/index.js')],
devtool: 'source-map',
output: {
filename: "main.js",
path: join(__dirname, '../../../public/user/'),
@rpf5573
rpf5573 / log_history.py
Last active Apr 4, 2019
카카오 오픈채팅방 알고리즘 코드
View log_history.py
# -*- coding: utf-8 -*-
# from : https://programmers.co.kr/learn/courses/30/lessons/42888?language=python3
ENTER = 'Enter'
ENTER_KOREAN = '들어왔습니다'
LEAVE = 'Leave'
LEAVE_KOREAN = '나갔습니다'
CHANGE = 'Change'
def solution(record):
View 로봇청소기.py
# from : https://www.acmicpc.net/problem/14503
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
CLEAN_SPACE = 2
def solution(table, position, direction):
noWay = False
View RGB.py
# from : https://www.acmicpc.net/problem/1149
def solution(N, table):
i = 1
while( i < len(table) ):
for m in range(3):
target = table[i][m]
for z in range(3):
if m != z:
s = target + table[i-1][z]
@rpf5573
rpf5573 / 실패율.py
Created Mar 21, 2019
2018 카카오 코딩테스트
View 실패율.py
// from : https://programmers.co.kr/learn/courses/30/lessons/42889?language=python3
def solution(N, stages):
totalPlayers = len(stages)
playersInStages = [0 for _ in range(N+1)]
for i in range(len(stages)):
z = stages[i]-1
playersInStages[z] = playersInStages[z]+1
failureRates = [0 for _ in range(N)]
View card_game.py
# -*- coding: utf-8 -*-
def solution(left, right):
total = 0
indexOfLeft = 0
indexOfRight = 0
lengthOfLeft = len(left)
lengthOfRight = len(right)
while( (lengthOfLeft != indexOfLeft) and (lengthOfRight != indexOfRight) ):
View triangle.py
def solution(triangle):
for i in range(len(triangle)-1, -1, -1):
for z in range(len(triangle[i]) - 1):
left = triangle[i][z]
right = triangle[i][z+1]
big = left if (left > right) else right
top = (i - 1, z)
triangle[top[0]][top[1]] = big + triangle[top[0]][top[1]]
return triangle[0][0]
You can’t perform that action at this time.