Skip to content

Instantly share code, notes, and snippets.

View EJSohn's full-sized avatar

Harley Son EJSohn

View GitHub Profile
@EJSohn
EJSohn / data-gatherer.py
Created February 3, 2016 01:43
collect and saving data using python Mechanize, BeautifulSoup library + sqlalchemy
# -*- coding: utf-8 -*-
# coded by eunjoo sohn. hanyang university
import re, sys, os, random, datetime
import mechanize
from bs4 import BeautifulSoup
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base

Oh my Angular2!

angular2의 튜토리얼을 따라가며 기억해야 할 점들을 기록한 gist.

https://angular.io/docs/ts/latest/tutorial

Tutorial-3 - Master/Detail

  1. input의 ngModel directive는 input value와 변수를 묶어준다.
@EJSohn
EJSohn / introrx.md
Created March 15, 2017 01:35 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@EJSohn
EJSohn / 1.swift
Last active May 2, 2018 11:34
swift enumeration
enum CompassPoint {
case east
case west
case south
case north
}
var directionToHead = CompassPoint.west
// or
var directionToHead: CompassPoint = .west
var directionToHead = CompassPoint.west
// or
var directionToHead: CompassPoint = .west
switch directionToHead {
case .west:
print("do something")
case .north:
print("do another thing")
default:
break
}
// Enumeration of type Fruit.
enum Fruit: Int {
case apple = 1000
case banana = 500
case grape = 2500
}
// declare variable.
let orderedFruit: Fruit = .apple
enum Cloud {
case cirrus
case cumulus
case altocumulus
case cumulonimbus
}
enum WeatherCondition {
case sunny(temperature: Float)
case rainy(inchesPerHour: Float)
// declare variables.
var today = WeatherCondition.sunny(24)
var yesterday = WeatherCondition.cloudy(Cloud.cirrus, 10)
switch today {
case .sunny(let temperature):
print("today's temperature is \(temperature).")
case .rainy(let inchesPerHour):
print("\(inchesPerHour) inches of rainwater.")