This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -type f -print0 | while IFS= read -r -d $'\0' filename; do | |
if [ -f "$1/$filename" ]; then | |
echo touch -r "$1/$filename" "$filename" | |
touch -r "$1/$filename" "$filename" | |
else | |
echo "$1/$filename" not exist | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="pattern"> | |
<test name="lang"> | |
<string>zh-cn</string> | |
</test> | |
<test qual="any" name="family"> | |
<string>serif</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Simple command line utility to create Zip64 files. | |
For Python 3.3+ | |
Most code are from the standard library `zipfile` and `shutil`. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import colorsys | |
""" | |
Black 0;30 Dark Gray 1;30 | |
Blue 0;34 Light Blue 1;34 | |
Green 0;32 Light Green 1;32 | |
Cyan 0;36 Light Cyan 1;36 | |
Red 0;31 Light Red 1;31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for fd in /proc/$1/fd/*; do | |
if [ ! -f "$fd" ]; then continue; fi | |
fdnum=$(basename "$fd") | |
fdinfo=/proc/$1/fdinfo/$fdnum | |
name=$(readlink "$fd") | |
size=$(stat -c "%s" "$name" 2>/dev/null || stat -c "%s" "$fd") | |
progress=$(grep ^pos "$fdinfo" | awk '{print $2}') | |
if [ $size -eq "0" ]; then | |
echo '['$fdnum']' "$name"':' $progress'/'$size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'Status: 200 OK' | |
echo 'Content-Type: text/html; charset=utf-8' | |
echo | |
echo '<!DOCTYPE html>' | |
echo '<html><head>' | |
echo '<meta http-equiv="content-type" content="text/html; charset=UTF-8">' | |
echo '<meta name="description" content="'"$HTTP_USER_AGENT"'">' | |
# we use CloudFlare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
''' | |
Get parallel corpus in Moses-style text from converted Tatoeba SQLite database. | |
Copyright (c) 2016 gumblex | |
This work is free. You can redistribute it and/or modify it under the | |
terms of the Do What The Fuck You Want To Public License, Version 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Ported from Paper.js - The Swiss Army Knife of Vector Graphics Scripting. | |
http://paperjs.org/ | |
Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey | |
http://scratchdisk.com/ & http://jonathanpuckey.com/ | |
Distributed under the MIT license. See LICENSE file for details. | |
All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright 2015 Gumble | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Licensed under WTFPL or the Unlicense or CC0. | |
# This uses Python 3, but it's easy to port to Python 2 by changing | |
# strings to u'xx'. | |
import itertools | |
def num2chinese(num, big=False, simp=True, o=False, twoalt=False): |