Skip to content

Instantly share code, notes, and snippets.

View ygpark2's full-sized avatar

Young Gyu Park ygpark2

View GitHub Profile
@ygpark2
ygpark2 / display_manager.py
Last active May 26, 2020 05:18
How to use Queue in threading
from queue import Queue, PriorityQueue
from threading import Thread
class DisplayManager(Thread):
def __init__(self, observer):
Thread.__init__(self)
self.queue = Queue()
@ygpark2
ygpark2 / keybase.md
Created November 27, 2017 03:33
keybase.md

Keybase proof

I hereby claim:

  • I am ygpark2 on github.
  • I am ygpark2 (https://keybase.io/ygpark2) on keybase.
  • I have a public key whose fingerprint is 3E3D C59D EA4B B475 B7FE 6AFF 0A84 0C16 3528 17B7

To claim this, I am signing this object:

@ygpark2
ygpark2 / SmartroService.java
Created May 27, 2016 00:53
Smartro 결제 관련 자바 클래스
package com.kdn.evcs.service;
import kr.co.smartro.xpg_pay.crypt;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.codec.net.URLCodec;
import org.aspectj.lang.annotation.Before;
import org.codehaus.jackson.JsonProcessingException;
import org.json.simple.JSONObject;
@ygpark2
ygpark2 / IpinService.java
Created May 27, 2016 00:52
Ipin 서비스 자바 클래스
package com.kdn.evcs.service;
import Kisinfo.Check.IPINClient;
import NiceID.Check.CPClient;
import com.kdn.evcs.common.BaseConstant;
import com.kdn.evcs.common.LogHelper;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import random
a = [random.randint(1,100) for _ in range(20)]
sorted_array = []
def swap(a, ppos, cpos):
a[ppos],a[cpos] = a[cpos],a[ppos]
print(a[ppos], a[cpos], ppos, cpos)
@ygpark2
ygpark2 / postgres.txt
Created July 22, 2014 07:05
PostgreSQL 명령어
Options:
-c, --connection-limit=N connection limit for role (default: no limit)
-d, --createdb role can create new databases
-D, --no-createdb role cannot create databases (default)
-e, --echo show the commands being sent to the server
-E, --encrypted encrypt stored password
-i, --inherit role inherits privileges of roles it is a
member of (default)
-I, --no-inherit role does not inherit privileges
@ygpark2
ygpark2 / multiplication_table.scala
Created July 22, 2014 05:30
multiplication table
List.fill(9)(1 to 9).zipWithIndex.map{ case(v, i) => v.map(a => f"$a%02d * ${i+1}%02d = ${a*(i+1)}%02d") }.flatten.map(println)
(1 to 9).flatMap( x => (1 to 9).map( (x, _) )).map(x => f"${x._1}%02d * ${x._2}%02d = ${x._1 * x._2}%02d").foreach(println)
@ygpark2
ygpark2 / http_client.rb
Last active August 29, 2015 14:02
ruby http client file
def http_client(url, method, headers={}, body=nil)
require 'net/http'
uri = URI.parse("#{url}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == "https"
request = "Net::HTTP::#{method.capitalize}".constantize.new(uri.request_uri)
headers.keys.each do |key|
request[key] = headers[key]
end
if body.is_a?(Hash)
MOVE
MOVE
MOVE
RIGHT
MOVE
REPORT
RIGHT
MOVE
RIGHT
MOVE
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is