Skip to content

Instantly share code, notes, and snippets.

View Jae-kwang's full-sized avatar
🥤

Jaekwang jung Jae-kwang

🥤
  • Line+ Corp
  • Republic of Korea
View GitHub Profile
@Jae-kwang
Jae-kwang / index.html
Last active June 3, 2022 08:56 — forked from lyudmil-mitev/index.html
CSS Transform Scale element to fit its parent
<html>
<head>
<title>CSS Transform Scale element to fit its parent</title>
<script src="scale2fit.js"></script>
<link rel="stylesheet" href="style.css" />
<script>
(function (window) {
function main() {
const margin = 10;
requestAnimationFrame(function fitToParentOnResize() {
@Jae-kwang
Jae-kwang / Github.js
Created March 21, 2018 11:31
CodeSpitz75-2
const Github = class {
constructor(id, repo) {
this._base = `http://api.github.com/repos/${id}/${repo}/contents/`;
}
load(path) {
const id = 'callback' + Github._id++;
const f = Github[id] = ({data:{content}}) => {
delete Github[id];
document.head.removeChild(s);
this._parser.loaded(content);
@Jae-kwang
Jae-kwang / index.html
Created March 13, 2018 23:58
CodeSpitz75-1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CodeSpitz75-1</title>
</head>
<body>
<section id="data"></section>
<script>
const Info = class {
@Jae-kwang
Jae-kwang / swap.js
Created December 22, 2017 02:21
Swap two number without variable
var x = 10;
var y = 5;
x = x + y // x = 15
y = x - y // y = 10
x = x - y // x = 5
@Jae-kwang
Jae-kwang / open_github.txt
Last active December 14, 2017 08:38
onen github repository
// 터미널에서 해당 위치의 github 페이지 열기
function og() {
local repo=$(basename `git rev-parse --show-toplevel`)
open "https://github.com/${repo}"
}
// insert .bashrc or .zshrc
// source .bashrc or .zshrc
@Jae-kwang
Jae-kwang / App.js
Created May 16, 2017 07:30 — forked from fdidron/App.js
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
.thumb {
display: inline-block;
width: 200px;
height: 200px;
margin: 5px;
border: 3px solid #c99;
background-position: center center;
background-size: cover;
}
@Jae-kwang
Jae-kwang / gist:ee59bd2bbc6dd720cf1c671542142358
Created April 26, 2017 04:37
element 를 중간에 위치시키는 방법
element 를 중간에 위치시키는 방법은 여러 가지가 있습니다.
element 의 너비, 높이가 고정이라면 [이건 방응형을 지원 합니다]
top: 50%; left: 50%; margin-top: -1 * height/2; margin-left: -1 * width/2;
@Jae-kwang
Jae-kwang / text_cnt.bootstrap.js
Created March 9, 2017 01:54
text count component
+function ($) {
/** Work Date
* - 2017.03.03
* - Jaekwang
*/
/** 사용 방법
* [required]
* - data-comp="cnt_letters"
@Jae-kwang
Jae-kwang / hacks.js
Created February 20, 2017 08:31 — forked from jhiebert/hacks.js
Uint8Array Support for IE8
(function() {
try {
var a = new Uint8Array(1);
return; //no need
} catch(e) { }
function subarray(start, end) {
return this.slice(start, end);
}