Skip to content

Instantly share code, notes, and snippets.

View dokenzy's full-sized avatar
🏠
Working from home

dokenzy dokenzy

🏠
Working from home
View GitHub Profile
import os
import re
import zipfile
from collections import defaultdict
from datetime import datetime
"""
Backup Django migration files
* Required Python 3.6+
"""
@dokenzy
dokenzy / docker-compose.yml
Last active February 9, 2019 12:57
redmine docker-compose
version: '3.1'
services:
redmine:
image: redmine:4.0.1
container_name: redmine
restart: always
ports:
- 8080:3000
environment:
@dokenzy
dokenzy / .envrc
Created November 3, 2018 05:16
pyenv + pyenv_virtualenv + direnv 설정
# -*- mode: sh; -*-
# (rootdir)/.envrc : direnv configuration file
# see https://direnv.net/
pyversion=3.7.1
pvenv=my_python_project_env_name
#
use python ${pyversion}
# Create the virtualenv if not yet done
layout virtualenv ${pyversion} ${pvenv}
# activate it
@dokenzy
dokenzy / logger.py
Created January 9, 2017 07:51
파이썬 3.4 로거
from datetime import datetime
import logging
import sys
from version import VERSION
def create_logger():
""" logging 객체를 만들어서 리턴한다.
:return: logging 객체
@dokenzy
dokenzy / html_structure_diff.py
Last active December 23, 2016 01:03
HTML 구조 비교
"""
date: 2016. 12. 22
author: Dokenzy
HTML 구조 비교
"""
from difflib import HtmlDiff
import re
import uuid
@dokenzy
dokenzy / forkme.svg
Created March 27, 2016 07:49 — forked from jnothman/forkme.svg
"Fork me on GitHub" ribbon in LaTeX/TikZ vector graphic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dokenzy
dokenzy / selenium-screenshotting.md
Created March 25, 2016 06:34 — forked from dannguyen/selenium-screenshotting.md
Using Selenium and Python to screenshot a javascript-heavy page

Using Selenium and Python to screenshot a javascript-heavy page

As websites become more JavaScript heavy, it's harder to automate things like screenshotting for archival purposes. I've seen examples and suggestions to use PhantomJS for visual testing/archiving of websites, but have run into issues such as the non-rendering of webfonts. I've never tried out Selenium until today...and while I'm not thinking about performance implications yet, Selenium seems far more accurate than PhantomJS...which makes sense since it actually opens a real browser. And it's not too hard to script to do complex interactions: here's an [example of how to log in to Twitter, write a tweet, upload an image, and send a tweet via Selenium and DOM element selection](https://gist.github.com/dannguyen/8a6fa49253c1d6a0eb92

@dokenzy
dokenzy / strike_latex.tex
Created March 6, 2016 07:24
latex에서 취소선 긋는 방법
\documentclass{article}
\usepackage{xcolor}
\usepackage{ulem}
\usepackage{soul}
\setstcolor{red}%%%
\usepackage{fontspec}
\usepackage{fontenc}
\usepackage{inconsolata}
\usepackage{erewhon}
@dokenzy
dokenzy / minipage_auto_width.tex
Last active February 22, 2016 15:36
minipage안에 한줄씩 들어가는 문자열 중에서 제일 긴 문자열을 minipage의 너비로 삼고자 할 때, LuaTeX을 이용해서 쉽게 하는 방법
\documentclass{article}
% http://blog.dokenzy.com/archives/2154
\usepackage{luacode}
\begin{luacode*}
texs = {'PDFLaTeX', 'XeTeX', 'LuaTeX'}
max = 0
for k, v in pairs(texs) do
if v:len() > max then
max = v:len()
end