Skip to content

Instantly share code, notes, and snippets.

View subicura's full-sized avatar

Chungsub Kim subicura

View GitHub Profile
@subicura
subicura / user_spec.rb
Last active January 1, 2016 02:09
remotty rspec guide
require 'spec_helper'
describe "User Model" do
context "Association" do
it { should have_many(:groups) }
end
context "Validation" do
it "name과 email속성을 가진다." do
@subicura
subicura / gist:8329759
Created January 9, 2014 05:21
유명 서비스들의 API Response 분석
@subicura
subicura / gist:8329767
Last active January 2, 2016 16:19
API Response guide
API Response 설계에 대한 가이드 문서입니다.
Status Code와 JSON Response(response body)로 정의합니다.

API 분석 참고

STATUS CODE

  • 200 - ok
    • index, show, update, 그외 대부분
  • 201 - create
    • create
# References:
# http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/
# http://blog.exceliance.fr/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
#
global
nbproc 2
maxconn 16384
defaults

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@subicura
subicura / Instructions.md
Last active August 29, 2015 14:27 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for issue number(#1234) or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@subicura
subicura / Docker swarm benchmark.md
Last active January 27, 2017 14:36
Docker swarm network test

Http Request Benchmark

간단하게 돌려봄. 정확하지 않을 수 있음. 테스트 할 때마다 값이 달라져서 적당한 추세정도만 확인하는 것으로..

Test

  • Host
    • MacBook Pro (Retina, 15-inch, Late 2013)
    • 2.3 GHz Intel Core i7 / 16GB 16000MHz DDR3
  • Test Server
@subicura
subicura / docker-stack.yml
Last active September 11, 2020 22:02
prometheus on swarm
# docker stack deploy --compose-file ./docker-stack.yml prom-stack
version: "3"
services:
prometheus:
image: prom/prometheus:latest
networks:
- monitoring
ports:
- 9001:9090
@subicura
subicura / prometheus.yml
Created April 16, 2017 07:36
prometheus on swarm (2)
global:
scrape_interval: 30s
evaluation_interval: 30s
external_labels:
monitor: "prometheus-swarm"
rule_files:
scrape_configs:
- job_name: 'prometheus'
@subicura
subicura / config.conf
Created January 12, 2018 10:46
neofetch config
# Neofetch config file
# https://github.com/dylanaraps/neofetch
# Speed up script by not using unicode
export LC_ALL=C
export LANG=C
myprin() {
if [ "$2" ]; then
get_$2 &>/dev/null