This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 루비(ruby)에서 한글 초성에 따라 필터링하기 예제. | |
# 한글 자모(가-힣). 정규식에서 사용 | |
hanguls = { | |
ㄱ:["\uAC00", "\uB097"], | |
ㄴ:["\uB098", "\uB2E3"], | |
ㄷ:["\uB2E4", "\uB77B"], | |
ㄹ:["\uB77C", "\uB9C7"], | |
ㅁ:["\uB9C8", "\uBC13"], | |
ㅂ:["\uBC14", "\uC0AB"], | |
ㅅ:["\uC0AC", "\uC543"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rootdir = "/var/nas/photo/" | |
for root, subdirs, files in os.walk(rootdir): | |
subdirs.remove('@eaDir') | |
print(root, subdirs, len(files)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example | |
# READING FILE(CSV key,value format) | |
# k1,v1 | |
# k1,v2 | |
# k2,v3 | |
# INTO | |
# k1 v1,v2 | |
# k2 v3 | |
# File open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 의존성 jar를 포함하여 빌드 --> | |
<properties> | |
<main.class>YourMainClass</main.class> <!-- jar 실행할 메인 클래스 --> | |
</properties> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-shade-plugin</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
become: true | |
tasks: | |
- name: Install basic packages | |
apt: | |
name: ['curl', 'apt-transport-https'] | |
state: present | |
force: yes | |
- name: Install Python3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('just a simple test') |
OlderNewer