Skip to content

Instantly share code, notes, and snippets.

View closer27's full-sized avatar

Seungwon Kim closer27

View GitHub Profile
@closer27
closer27 / DomRenderer.js
Created March 29, 2018 11:00
CodeSpitz75_w3_practice1
const DomRenderer = class {
constructor(list, parent) {
this._parent = parent;
this._list = list;
this._sort = 'title';
}
add(parent, title, date) {
parent.add(new TaskItem(title, date));
this.render();
}
@closer27
closer27 / Github.js
Created March 23, 2018 13:01
CodeSpitz75_w2_practice2
const Github = class {
constructor(id, repo) {
this._base = `https://api.github.com/repos/${id}/${repo}/contents/`;
}
load(path) {
if (!this._parser) return;
const id = 'callback' + Github._id++;
const f = Github[id] = ({data:{content}})=>{
delete Github[id];
@closer27
closer27 / Github.js
Created March 21, 2018 13:55
CodeSpitz75_w2_practice1
const Github = class {
constructor(id, repo) {
this._base = `https://api.github.com/repos/${id}/${repo}/contents/`;
}
load(path) {
if (!this._parser) return;
const id = 'callback' + Github._id++;
const f = Github[id] = ({data:{content}})=>{
delete Github[id];
@closer27
closer27 / Swift JSON Playground
Last active November 2, 2017 14:37 — forked from benrigas/Swift JSON Playground
Swift4 Playground for initializing objects from Dictionary/JSON
// Playground - noun: a place where people can play
import Cocoa
extension String {
func dictionaryFromJSON () -> Dictionary<String, AnyObject>? {
do {
if let data = self.data(using: .utf8), let dict = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.allowFragments) as? [String: AnyObject] {
return dict
}
- (void)rotateLabelUp {
[UIViewanimateWithDuration:0.5 animations:^{
_label.transform = CGAffineTransformMakeRotation(0);
} completion:^(BOOL finished){
[selfrotateLabelDown];
}];
}
- (void)rotateLabelDown {
[UIViewanimateWithDuration:0.5 animations:^{
@closer27
closer27 / LinkedList.java
Last active June 19, 2016 11:14
Basic LinkedList
public class LinkedList {
private Node head;
public LinkedList () {
}
public void addNode (Node newNode) {
if (head == null) {
head = newNode;
return;
@closer27
closer27 / gist:7805359
Created December 5, 2013 13:46
nginx conf in raspberry pi
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/var/run/php5-fpm.sock;
}
server {
## Your only path reference.
root /var/www/wordpress;
listen 80;