Skip to content

Instantly share code, notes, and snippets.


Sangkon, Han sigmadream

View GitHub Profile
$ sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
$ sudo apt-get install ntp
# Snippet Code
from flask import Flask, render_template, jsonify, request
from threading import Timer, Thread
from time import sleep
app = Flask(__name__)

ipython 기초

ipython 소개

  • 엄청 좋은 '인터렉티브 쉘'함
  • 브라우저에서도 '코드'로 개발 가능함
  • 코딩과 문서화, 테스트까지 가능함

ipython 설치

  • python 3.x 설치
  • numpy, matplotlib, pandas,

Ubuntu 설치

Oracle JDK 7 Install

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-set-default

Zookeeper Install and Setting

sigmadream / Capfile
Last active Apr 28, 2016
Deploy Rails 5.0.0.beta3(Nginx, Puma, Capistrano3, PostgreSQL, rbenv)
View Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/nginx'
require 'capistrano/puma'
require 'capistrano/puma/nginx'
require 'capistrano/rbenv'
require 'capistrano/rails'
require 'capistrano/rails/db'
require 'capistrano/rails/console'
require 'capistrano/upload-config'

시간 이쁘게 나타내기!

function timeStamp() {
  var now = new Date();
  var date = [ now.getFullYear(), now.getMonth() + 1, now.getDate() ];
  var time = [ now.getHours(), now.getMinutes(), now.getSeconds() ];
  var suffix = ( time[0] < 12 ) ? "AM" : "PM";
  time[0] = ( time[0] < 12 ) ? time[0] : time[0] - 12;
  time[0] = time[0] || 12;

큰 틀에 아래와 같은 작업을 진행해야 함


Nginx 관련

server {
   listen 80 443;
sigmadream /
Created Nov 29, 2016 — forked from dvm-shlee/
pykoen, jupyter notebook 을 이용한 interactive 한영번역기 (구글번역기 + Ginger 문법교정기)
from __future__ import absolute_import
import json
import sys
import re
import requests
import urllib
import urlparse
from urllib2 import HTTPError
from urllib2 import URLError
from urllib2 import urlopen

Ruby on Rails {4, 5.0.0.beta} for OSX

Installing Homebrew

ruby -e "$(curl -fsSL"

rbenv Install

$ brew install rbenv ruby-build
sigmadream /
Last active Aug 20, 2017
정규식을 사용해서 `.(dot)`이 포함된 값을 지닌 객체를 삭제
db.getCollection('activities').find({"actList.c": {$regex: "[.]{1}"}})