Skip to content

Instantly share code, notes, and snippets.

@jinhoyim
jinhoyim / multiplication-table.js
Created September 13, 2018 09:02
s78-day2-multiplication-table
const generator = function* (i, j) {
for (let left = 1; left <= j; left++) {
for (let right = 1; right <= i; right++) {
yield [left, right, left * right];
}
}
};
for (const [i, j, k] of generator(9, 9)) {
console.log(`${i} x ${j} = ${k}`);
@jinhoyim
jinhoyim / Github.js
Created March 18, 2018 15:32
s75-day2-practice2
const Github = class {
constructor(id, repo) {
this._base = `https://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[0](content, ...this._parser[1]);
@jinhoyim
jinhoyim / Github.js
Created March 18, 2018 15:26
s75-day2-practice1
const Github = class {
constructor(id, repo) {
this._base = `https://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.parse(content);
@jinhoyim
jinhoyim / s75-day1-practice.html
Created March 11, 2018 09:35
CodeSpitz-S75-Day1-Practice
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CodePitz75-1</title>
</head>
<body>
<section id="data"></section>
@jinhoyim
jinhoyim / LinkedList.cs
Created November 17, 2016 16:00
Linked List(C#)
public class LinkedList<T>
{
public class Node
{
public T data = default(T);
public Node next;
public Node()
{
@jinhoyim
jinhoyim / list-style-bullet-color.css
Created October 8, 2016 11:44
List Style Bullet Color
/* optional */
* { margin: 0; padding: 0; border: 0 none; font-size: 100%; }
body { padding: 10em; background: #FFF; color: #333; font: 14px/1.5 sans-serif; }
/* unordered lists */
ul {
margin: 0 0 1.5em;
padding: 0;
list-style: none;
}