Skip to content

Instantly share code, notes, and snippets.

Avatar

Sangkon, Han sigmadream

View GitHub Profile
View ec2_setting_localtime_ntp.md
$ sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
$ sudo apt-get install ntp
View flask_with_cron.py
# Snippet Code
from flask import Flask, render_template, jsonify, request
from threading import Timer, Thread
from time import sleep
app = Flask(__name__)
@app.route("/api/<method>")
View ipython_breif.md

ipython 기초

ipython 소개

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

ipython 설치

  • python 3.x 설치
  • numpy, matplotlib, pandas,
View install_Kafka_in_Ubuntu.md

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
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'
View Firebase_orderby.md

시간 이쁘게 나타내기!

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;
View express_with_nginx.md

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

====

Nginx 관련

server {
   listen 80 443;
   server_name example.com;
   
@sigmadream
sigmadream / pykoen.py
Created Nov 29, 2016 — forked from dvm-shlee/pykoen.py
pykoen, jupyter notebook 을 이용한 interactive 한영번역기 (구글번역기 + Ginger 문법교정기)
View pykoen.py
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
View install_ruby_on_rails.md

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

Installing Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

rbenv Install

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