Skip to content

Instantly share code, notes, and snippets.

View CreatiCoding's full-sized avatar
❤️
Maybe busy by something

정석호 CreatiCoding

❤️
Maybe busy by something
View GitHub Profile
wget -O - https://s3.ap-northeast-2.amazonaws.com/cdn.fedev.kr/script/vundle.sh | bash
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@CreatiCoding
CreatiCoding / array_chunk.js
Last active June 23, 2020 02:31
js array chunk function
// version 1 원본 훼손
const chunk = (list, size) =>
new Array(parseInt(list.length / size))
.fill()
.map(() => list.splice(0, size));
// version 2 원본 유지
const chunk = (list, size) =>
new Array(parseInt(list.length / size))
.fill()
ls | xargs du -sh
@CreatiCoding
CreatiCoding / hasSafeArea.js
Last active April 20, 2020 03:37 — forked from dohoons/getSafeArea.js
hasSafeArea()
function hasSafeArea() {
const div = document.createElement('div');
const computed = getComputedStyle(div);
div.style.paddingBottom = 'env(safe-area-inset-bottom)';
document.body.appendChild(div);
const bottom = parseInt(computed.paddingBottom) || 0;
document.body.removeChild(div);
@CreatiCoding
CreatiCoding / GIF2MP4.vue
Last active April 10, 2020 01:13
vue component for gif to mp4 convertor with ffmpeg
<template>
<div id="app">
<div>
<input type="file" @change="previewFile" />
<br />
<img src height="200" alt="이미지 미리보기..." />
<button @click="doConvert">다운로드</button>
</div>
</div>
</template>
@CreatiCoding
CreatiCoding / 100ms_delay.js
Created April 9, 2020 03:25
javascript delay in async area
await (() => new Promise((resolve) => setTimeout(() => resolve(true), 100)))();
@CreatiCoding
CreatiCoding / index.ts
Created April 4, 2020 16:42
Firebase Cloud Functions GraphQL
import { https } from "firebase-functions";
import * as express from "express";
import { ApolloServer, gql } from "apollo-server-express";
const typeDefs = gql`
# Comments in GraphQL strings (such as this one) start with the hash (#) symbol.
# This "Book" type defines the queryable fields for every book in our data source.
type Book {
title: String
@CreatiCoding
CreatiCoding / set-config.sh
Created October 24, 2019 12:45
shell script programming
#!/bin/bash
uname_out="$(uname -s)"
case "${uname_out}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${uname_out}"
esac
@CreatiCoding
CreatiCoding / dayjs.locale.js
Created October 23, 2019 08:09
dayjs 로케일 설정
dayjs(new Date().toLocaleString("en-US", {timeZone: "Asia/Seoul"})).format('YYYY-MM-DD HH:mm:ss')