Skip to content

Instantly share code, notes, and snippets.

View minjejeon's full-sized avatar

Minje Jeon minjejeon

  • Bank of Korea
  • Seoul, Korea
View GitHub Profile
@minjejeon
minjejeon / add-context-menu.reg
Last active October 22, 2024 10:18 — forked from navhaxs/add-context-menu.reg
Convert HEIC to JPG context menu Windows 10
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\.heic\Shell\Convert-to-Jpg\command]
@="\"C:\\Program Files\\ImageMagick-7.1.1-Q16-HDRI\\magick.exe\" mogrify -format jpg \"%1\""
@minjejeon
minjejeon / lotto.py
Created August 17, 2024 06:37
온라인 로또 5000원
import numpy as np
for x in range(5):
print(np.sort(np.random.choice(range(1,46),6,replace=False)))
@minjejeon
minjejeon / Dockerfile
Last active February 16, 2023 16:36 — forked from kmpm/install-weasyproxy.sh
Small file that installes ad uses weasyprint instead of wkhtmltopdf on linuxserver bookstack containers..
FROM linuxserver/bookstack:latest
COPY ./install-weasyproxy.sh /tmp/
RUN sh /tmp/install-weasyproxy.sh
RUN mkdir /custom-cont-init.d/
COPY ./init-weasyproxy.sh /custom-cont-init.d/
@minjejeon
minjejeon / week2.ipynb
Created March 15, 2021 14:10
경영통계분석 week2 발표자료
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@minjejeon
minjejeon / spark-cluster.cmd
Last active July 13, 2019 06:58
spark cluster on windows
start /b spark-master.cmd
timeout 2 > NUL
start /b spark-worker.cmd
@minjejeon
minjejeon / gist:0e5562468f83274679e8bfa56fa1937e
Last active August 24, 2020 08:29 — forked from philippeowagner/gist:6530635
Having troubles with 'latin1_swedish_ci' on your MySQL Databases? Specially `OperationalError (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='")`? No problem, fix it using Django's shell.This solution is based on this http://stackoverflow.com/questions/1073295/django-character-set-w…
from django.db import connection
from django.conf import settings
cursor = connection.cursor()
cursor.execute('SHOW TABLES')
results=[]
for row in cursor.fetchall():
results.append(row)
for row in results:
cursor.execute('ALTER TABLE %s CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;' % (row[0]))
@minjejeon
minjejeon / 1-import pandas
Created November 30, 2016 17:25
snippets for data analysis
import pandas as pd
import numpy as np
from pandas import DataFrame, Series
@minjejeon
minjejeon / useful_pandas_snippets.py
Created September 23, 2016 15:01 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
@minjejeon
minjejeon / matplot_hangul.ipynb
Last active September 17, 2016 14:06
matplotlib 한글, inline svg 출력 세팅
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@minjejeon
minjejeon / instPkgPlusDeps.R
Created August 25, 2016 02:43
R 패키지 다운로드
instPkgPlusDeps <- function(pkg, download = TRUE,
which = c("Depends", "Imports", "LinkingTo"),
inc.pkg = TRUE) {
stopifnot(require("tools")) ## load tools
ap <- available.packages() ## takes a minute on first use
## get dependencies for pkg recursively through all dependencies
deps <- package_dependencies(pkg, db = ap, which = which, recursive = TRUE)
## the next line can generate warnings; I think these are harmless
## returns the Priority field. `NA` indicates not Base or Recommended
pri <- sapply(deps[[1]], packageDescription, fields = "Priority")