Skip to content

Instantly share code, notes, and snippets.

@hyoiutu
hyoiutu / convertSVG.pl
Created December 15, 2019 13:13
Perl script for convert to SVG to TikZ
use strict;
use warnings;
use utf8;
sub read_SVG_info {
my $file_name = shift;
my $svg_lines = load_SVG_file($file_name);
my ($max_x, $max_y) = read_draw_area($svg_lines);
@hyoiutu
hyoiutu / jupytex.sty
Created December 16, 2017 07:08
JupyTeX
\RequirePackage[makestderr]{pythontex}
\RequirePackage[many]{tcolorbox}
\tcbuselibrary{breakable}
\RequirePackage{color, xcolor}
\RequirePackage{xparse}
\newtcolorbox[]{outframebox}{enhanced, fuzzy halo=1.8pt with black!30, breakable=true,
colback=white,
boxrule=0.1pt,
top=0mm,
@hyoiutu
hyoiutu / shaping_articles.py
Created December 11, 2017 15:36
SS本文のデータ整形
import re
import glob
from itertools import chain
import MeCab
from joblib import Parallel, delayed
target_name = "みりあ"
tagger = MeCab.Tagger("-Owakati")
@hyoiutu
hyoiutu / scrape_article.py
Last active December 11, 2017 15:28
SSサイトから記事を取得
import lxml.html
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import re
from functools import reduce
import os
from time import sleep
import socket
from selenium.webdriver.chrome.options import Options
@hyoiutu
hyoiutu / get_links.py
Created December 11, 2017 15:18
SSまとめサイトのリンクのリストを取得
@hyoiutu
hyoiutu / preprocess_tweets.py
Last active December 11, 2017 15:07
Tweetの前処理
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import MeCab
from datetime import datetime
from joblib import Parallel, delayed
from time import time
from more_itertools import pairwise
@hyoiutu
hyoiutu / fractal.sty
Created April 22, 2017 09:20
フラクタル図形を描画するfractal.sty
\RequirePackage{pgf}
\RequirePackage{tikz}
\RequirePackage{calc}
\newcounter{deep}
\newlength{\treeBold}
\def\Tree#1#2#3#4#5{{
\pgfmathsetmacro{\xA}{#1}
\pgfmathsetmacro{\yA}{#2}