Skip to content

Instantly share code, notes, and snippets.

View tankxu's full-sized avatar
:octocat:

Tank Xu tankxu

:octocat:
View GitHub Profile
@tankxu
tankxu / pdf2image.sh
Last active January 15, 2020 16:26
Convert multi page pdf to a single jpg file
#! /bin/bash
# set -e
for file in ./pdf/*
do
fileName=$(basename -- "$file")
fileName="${fileName%.*}"
# echo $filename
pdfName=./pdf/$fileName.pdf
outputName=./jpg/$fileName.jpg
@tankxu
tankxu / gif图片压缩.md
Created June 28, 2019 07:44
Gif 图片压缩

方法一:

gifsicle -O3 --lossy=130 input.gif -o output.gif

lossy 的值越大压缩越严重

方法二:

convert input.gif -fuzz 15% -layers Optimize output.gif
@tankxu
tankxu / A list of sketch scripts
Last active June 14, 2020 03:47
Sketch Script
A list of sketch scripts

Keybase proof

I hereby claim:

  • I am tankxu on github.
  • I am tankxu (https://keybase.io/tankxu) on keybase.
  • I have a public key whose fingerprint is D505 7C14 6BBA EA2F 1165 FD79 2049 DF9B 8E4E 378A

To claim this, I am signing this object:

@tankxu
tankxu / ttc2ttf.py
Last active August 29, 2015 14:23 — forked from kayahr/ttc2ttf.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#First released as C++ program by Hiroyuki Tsutsumi as part of the free software suite “Beer”
#I thought porting it to Python could be both a challenge and useful
from sys import argv, exit, getsizeof
from struct import pack_into, unpack_from
def ceil4(n):