Skip to content

Instantly share code, notes, and snippets.

View suminb's full-sized avatar

Sumin Byeon suminb

View GitHub Profile
@suminb
suminb / demo1.py
Last active July 2, 2018 17:17
Demo for a lecture at WISET (2018-05-11)
"""웹브라우저 띄워서 가져오는 예제 (느림)"""
import csv
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
@suminb
suminb / concat_mp4.sh
Last active October 11, 2020 08:17
Concat mp4 files with ffmpeg
#!/bin/bash
#ffmpeg -f concat -i <(find . -name '*.mp4' -printf "file '%p'\n") -c copy output.mp4
#ffmpeg -f concat -i <(printf "file '$(pwd)/%s'\n" *.mp4) -c copy output.mp4
#ffmpeg -f concat -i <(for f in ./*.mp4; do echo "file '$f'"; done) -c copy output.mp4
list_file="list.txt"
archive_path="processed"
function get_unique_dates {
{"context":{"dispatcher":{"stores":{"PageStore":{"currentPageName":"quote","currentRenderTargetId":"default","pagesConfigRaw":{"base":{"quote":{"layout":{"bundleName":"yahoodotcom-layout.TwoColumnLayout","name":"TwoColumnLayout","config":{"enableHeaderCollapse":true,"Header":{"isFixed":true,"uhContainerClasses":"Bgi($uhGrayGradient)","navContainerClasses":"Bgi($navrailGrayGradient) Bxsh($navrailShadow) Pos(r) hasScrolled_Bxsh(headerShadow) Panel-open_Bxsh(headerShadow)","height":135,"navTransitionClasses":"HideNavrail_Translate3d(0,-46px,0) Panel-open_Translate3d(0,-46px,0)","secondaryNavContainerClasses":"hasScrolled_Bdbw(0px) Bxsh($navrailShadow)"},"fetchNewAttribution":true},"meta":{"property":{"twitter:site":"@YahooFinance"}}},"meta":{"property":{"twitter:site":"@YahooFinance"}},"spaceid":95993639,"ads":{"events":{"adFetch":{"ps":"FB2,FB2-1,FB2-2,FB2-3,LDRB,LREC,LREC2,FOOT,FSRVY","firstRender":"FB2,FB2-1,FB2-2,FB2-3,LDRB,LREC"},"AUTO":{"autoDDG":0}},"deferRender":true,"positions":{"MAST":{"fclose":2,"fdb"
@suminb
suminb / aws_latency_map.html
Last active June 18, 2017 06:57
WIP: AWS world latency map
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.9/topojson.min.js"></script>
<script src="datamaps.world.hires.min.js"></script>
<div id="container" style="position: relative; width: 500px; height: 300px;"></div>
<script>
var aws = {
// Tokyo
@suminb
suminb / Nancy.cs
Created June 1, 2017 10:02
Nancy self-hosted web service
using System;
using Nancy;
using Nancy.Hosting.Self;
// netsh http add urlacl url="http://+:8029/" user="Everyone"
namespace WebFrontend
{
public class SampleModule : NancyModule
{
@suminb
suminb / index.tmpl
Created March 29, 2017 17:56
Golang Practice
<!-- This file must be under `templates` directory -->
<h1>Hello World!</h1>
<div>{{.}}</div>
<div>{{ .key }}</div>
from operator import attrgetter
import random
import sys
import click
from logbook import Logger, StreamHandler
StreamHandler(sys.stderr).push_application()
log = Logger(__name__)
@suminb
suminb / ocl_device_query.txt
Last active February 1, 2017 11:41
Run OpenCL code with Python
C:\users\suminb\Downloads\oclDeviceQuery.exe Starting...
OpenCL SW Info:
CL_PLATFORM_NAME: NVIDIA CUDA
CL_PLATFORM_VERSION: OpenCL 1.1 CUDA 6.5.14
OpenCL SDK Revision: 7027912
OpenCL Device Info:
@suminb
suminb / kanpsack.py
Last active October 27, 2016 15:41
이상한 호주 여행기 - 비용 정산 편에 소개 된 배낭 문제 코드입니다.
values = [
16199, 10906, 3382, 84725, 71294, 36372, 21256, 18555, 21636, 19425, 18688,
10482, 7613, 74453, 58176, 50942, 26950, 26582, 9589, 9520, 210198, 50818,
36992, 17732, 16953, 9971, 8031, 5247, 372309]
limit = 312967
def m(i, limit, values, taken, cache):
"""Calculates the maximum value that can be attained with total value less
than or equal to `limit`.
import sys
def parse_column(line):
cols = line.split('\t')
col_count = len(cols)
if col_count == 13:
return cols
elif col_count == 12: