Skip to content

Instantly share code, notes, and snippets.

View johnjohnlin's full-sized avatar

Yu-Sheng Lin johnjohnlin

  • Taiwan
View GitHub Profile
@johnjohnlin
johnjohnlin / .gitconfig
Created October 4, 2022 16:33
My configuration backup
[user]
name = Yu-Sheng Lin
email = johnjohnlys@gmail.com
[core]
editor = nvim
pager =
[push]
default = current
[color]
ui = auto
@johnjohnlin
johnjohnlin / odg2svgs.py
Created September 22, 2020 16:28
A simple script converting an odg file into individual SVG pages, works for libreoffice 7.0
#!python
# usage: if you have an xxx.odg, then execute `./odg2svgs.py xxx`
import sys
import subprocess
import xml.etree.ElementTree as ET
kBASENAME = sys.argv[1]
subprocess.run(["libreoffice", "--draw", "--headless", "--convert-to", "svg", kBASENAME+".odg"], check=True)
tree = ET.parse(kBASENAME + ".svg")
@johnjohnlin
johnjohnlin / leetcode_tree.cpp
Created June 18, 2019 10:00
A snippet that can help you make TreeNode structure from Leetcode tree text like [1,2,-3,-5,null,4,null].
#include <algorithm>
#include <utility>
#include <stack>
#include <vector>
using namespace std;
#define null nullptr
struct TreeNode {
int val;
TreeNode *left;