Skip to content

Instantly share code, notes, and snippets.

View samsee's full-sized avatar
🏄‍♂️

Seungyoon Lee samsee

🏄‍♂️
View GitHub Profile
@samsee
samsee / 한글 자모 정규식.rb
Last active April 14, 2016 05:01
Array to Hash, Key is Hangul(Korean Alphabet) Jaeum.
# 루비(ruby)에서 한글 초성에 따라 필터링하기 예제.
# 한글 자모(가-힣). 정규식에서 사용
hanguls = {
:["\uAC00", "\uB097"],
:["\uB098", "\uB2E3"],
:["\uB2E4", "\uB77B"],
:["\uB77C", "\uB9C7"],
:["\uB9C8", "\uBC13"],
:["\uBC14", "\uC0AB"],
:["\uC0AC", "\uC543"],
@samsee
samsee / http_req_and_res_sample.rb
Created April 14, 2016 05:07
Ruby http request and response sample
require 'net/http'
require 'uri'
require 'nokogiri'
# Assign URI to request.
uri = URI.parse("http://abc.def/ghi")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
@samsee
samsee / directory_traverse.py
Last active November 5, 2018 13:40
duplicated image search on synology photostation
rootdir = "/var/nas/photo/"
for root, subdirs, files in os.walk(rootdir):
subdirs.remove('@eaDir')
print(root, subdirs, len(files))
@samsee
samsee / csvconcat.rb
Created February 14, 2019 08:26
CSV to key, values concat
# Example
# READING FILE(CSV key,value format)
# k1,v1
# k1,v2
# k2,v3
# INTO
# k1 v1,v2
# k2 v3
# File open
@samsee
samsee / rabbitmq-receive-message.py
Created March 7, 2019 10:59
RabbitMQ message send/receive
import pika
IP = __YOUR_RABBITMQ_IP__
PORT = __YOUR_RABBITMQ_PORT__
connection = pika.BlockingConnection(pika.ConnectionParameters(host=IP, port=PORT))
channel = connection.channel()
channel.queue_declare(queue='hello')
@samsee
samsee / rabbitmq_emit_log.py
Last active March 7, 2019 11:18
RabbitMQ Tutorial Codes
import pika
import sys
IP = __YOUR_RABBITMQ_IP__
connection = pika.BlockingConnection(pika.ConnectionParameters(host=IP))
channel = connection.channel()
channel.exchange_declare(exchange='logs',
exchange_type='fanout')
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.Arrays;
import java.util.Collection;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
@samsee
samsee / MavenUberJar.xml
Created March 21, 2019 01:29
Java Build
<!-- 의존성 jar를 포함하여 빌드 -->
<properties>
<main.class>YourMainClass</main.class> <!-- jar 실행할 메인 클래스 -->
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
@samsee
samsee / django-react-debian.yml
Last active March 31, 2019 11:17
ansible playbooks
---
- hosts: localhost
become: true
tasks:
- name: Install basic packages
apt:
name: ['curl', 'apt-transport-https']
state: present
force: yes
- name: Install Python3.4
@samsee
samsee / hello.py
Created June 19, 2019 07:02
Hello
print('just a simple test')