Skip to content

Instantly share code, notes, and snippets.

🏠
Working at home

Sejong Yang kingsj0405

🏠
Working at home
Block or report user

Report or block kingsj0405

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kingsj0405
kingsj0405 / multimap.cpp
Last active May 16, 2019
C++ STL Example
View multimap.cpp
/*
Example Input:
7
6
1 2
2 3
1 5
5 2
5 6
4 7
View compare-face.py
"""
This program is wrapper of face_recognition on the following link
https://github.com/ageitgey/face_recognition
You need to install followings
- Python3.3+ or Python2.7
- dlib
- face_recognition
For more information visit ageithey/face_recognition
@kingsj0405
kingsj0405 / check_cnt_of_pep.js
Last active Apr 9, 2019
연세대학교 관련 스크립트
View check_cnt_of_pep.js
// 신청인원 보고서
// 신청내역 나오는 화면에서 콘솔(F12) 열어서
var data_my_mil;
var finished1 = false;
var finished2 = false;
function call_data(){
call_data2();
jQuery('table').fadeTo('fast',0.5);
finished1 = false;
@kingsj0405
kingsj0405 / NaverCafe.php
Last active Feb 5, 2019
싸이월드 to 네이버카페 migrator
View NaverCafe.php
<?php
class NaverCafe{
private $access_token = "";
function __construct($access_token) {
$this->access_token = $access_token;
}
static function encodeInput($input) {
return urlencode(str_replace('"', '\"', $input));
}
@kingsj0405
kingsj0405 / change_name_of_files.py
Created Aug 27, 2018
Change file names in same directory
View change_name_of_files.py
from os import getcwd, rename
from os.path import join
from glob import glob
current_directory = getcwd()
file_names = glob(join(current_directory, '*.png'))
for i, fn in enumerate(file_names):
ori_path = str(fn)
directory = "\\".join(ori_path.split("\\")[0:-1])
new_path = join(directory, str(i) + ".png")
@kingsj0405
kingsj0405 / add_border.py
Created Aug 15, 2018
Add border to images
View add_border.py
import os
from PIL import Image
border_radius = 4
file_list = [fn for fn in os.listdir('.') if fn.split(".")[-1] == 'jpg']
print("image_list: ", file_list)
for file_name in file_list:
old_im = Image.open(file_name)
View Download Google Drive files with WGET
function gdrive_download () {
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -rf /tmp/cookies.txt
}
View django-secret-keygen.py
"""
Pseudo-random django secret key generator.
- Does print SECRET key to terminal which can be seen as unsafe.
"""
import string
import random
# Get ascii Characters numbers and punctuation (minus quote characters as they could terminate string).
chars = ''.join([string.ascii_letters, string.digits, string.punctuation]).replace('\'', '').replace('"', '').replace('\\', '')
@kingsj0405
kingsj0405 / diningcode_crawler.py
Last active Aug 24, 2017
dining code crawler
View diningcode_crawler.py
from urllib import request
from bs4 import BeautifulSoup
with open('output.txt', 'w') as outfile:
for i in range(1, 11):
#url = 'http://www.diningcode.com/list.php?page=' + str(i) + '&chunk=10&query=%EB%8F%99%ED%83%84'
url = 'http://www.diningcode.com/list.php?page=' + str(i) + '&chunk=10&query=%EC%96%91%EC%9E%AC'
content = request.urlopen(url).read()
soup = BeautifulSoup(content)
for name in soup.findAll('div', { 'class' : 'dc-restaurant-name' }):
You can’t perform that action at this time.