Skip to content

Instantly share code, notes, and snippets.

@haruair
haruair / quicktodo.md
Last active August 3, 2016 02:42
quick todo

3분기

  • 책 8월 내로 마무리하기

4분기

  • 이모콘 준비
  • 11월 미국 방문
  • UWP로 앱 하나 만들기
  • 집에 쌓인 책 다 읽기
@haruair
haruair / writing.html
Created August 3, 2016 07:45
editor draft
<!doctype html>
<html>
<head>
<style>
@import url(https://fonts.googleapis.com/css?family=Merriweather:400,700,300,900);
.placeholderText {
font-family: 'Merriweather', 'apple sd gothic neo', serif;
border: 0;
background: #fafafa;
@haruair
haruair / address.py
Last active September 15, 2016 07:28
SQLAlchemy dirty convert using Normalizable
from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import relationship, backref
from database import Base
from util import Normalizable
class Address(Base, Normalizable):
@haruair
haruair / slack-wc-client.py
Created August 23, 2016 04:21
slack wc client
from websocket import create_connection
import json
import signal
import sys
import requests
key = "" # me key
channelId = "C03BXUL0Q" # general
r = requests.get('https://slack.com/api/rtm.start?token='+key)
@haruair
haruair / DefaultLayout.swift
Created November 29, 2016 05:16
당연히 작동 안합니다
class DefaultLayout : Layout {
let definitions = [
(PickButton, BottomButtonRepresentation),
(CameraView, FullScreenRepresentation),
(OverlayFlashView, FullScreenRepresentation),
]
}
@haruair
haruair / DefaultLayout.swift
Created November 29, 2016 05:23
비스무리하게 구현하면
class DefaultLayout : Layout {
let definitions = [
Definition(PickButton.self, BottomButtonRepresentation.self),
Definition(CameraView.self, FullScreenRepresentation.self),
Definition(OverlayFlashView.self, FullScreenRepresentation.self),
]
}
class Definition {
var elementType : Any?
# 0 is too far from ` ;)
set -g base-index 1
set -g prefix ^b
setw -g xterm-keys on
set -g default-terminal "screen-256color"
# Automatically set window title
set-window-option -g automatic-rename on
@haruair
haruair / DI.php
Last active April 20, 2017 00:31
small DI classes
<?php
namespace Wattle\DI;
use ReflectionClass;
use Exception;
use Closure;
/**
* Scope Implementation.
*/
<?php
interface FoodInterface
{
}
class FriedChicken implements FoodInterface
{
public function getName()
{
return self::class;
@haruair
haruair / es.js
Created August 31, 2017 14:40
event sourcing js practice code
function generatedId() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
)
}
class LocalStorageEventStore {
getStorage() {
var raw = window.localStorage.getItem('event-store')
var data = JSON.parse(raw) || []