Skip to content

Instantly share code, notes, and snippets.

View koyokr's full-sized avatar

Younghun Ko koyokr

View GitHub Profile
@koyokr
koyokr / study.js
Last active June 12, 2018 14:21
study async await
(async () => {
'use strict';
const loadedEvent = (f, l) => new Promise(r => {
f.addEventListener('load', () => {
const d = f.contentDocument;
if (d.readyState === 'complete' || (d.readyState !== 'loading' && !d.documentElement.doScroll)) r();
else d.addEventListener('DOMContentLoaded', r);
}, { once: true });
l();
@koyokr
koyokr / epoll.c
Created June 4, 2018 04:37
c socket example
#include <sys/epoll.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#define MAX 1024