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
@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);
ls | xargs du -sh
@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()
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
wget -O - https://s3.ap-northeast-2.amazonaws.com/cdn.fedev.kr/script/vundle.sh | bash
@CreatiCoding
CreatiCoding / scaler.js
Created July 29, 2020 01:15
img tag scaler
export default class Scaler {
constructor(el) {
this.zoom_size = 1;
this.zoom_pos = {};
this.touches_length = 0;
this.image_top = 0;
this.scale = 1;
this.init_distance = null;
@CreatiCoding
CreatiCoding / media-style.css
Created August 27, 2020 15:03
bootstrap media query
/* Large desktops and laptops */
@media (min-width: 1200px) {
}
/* Landscape tablets and medium desktops */
@media (min-width: 992px) and (max-width: 1199px) {
}
@CreatiCoding
CreatiCoding / no-cache.html
Created March 9, 2021 17:31
no-cache.html
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Pragma" content="no-cache" />
@CreatiCoding
CreatiCoding / index.js
Created July 18, 2021 06:25
JS 클래스와 함수
function Person(name){ this.name = name; }
Person.prototype.say = function(){ console.log(this.name); }
var creco = new Person("creco")
creco.say()
class Person2 {
constructor(name) {
this.name = name;
}
git update-index --assume-unchanged file