Skip to content

Instantly share code, notes, and snippets.

# coding=utf8
'''
2012/7/26
encode and decode a normal tree (children can be more than 2) to and from string (format of your own choice)
'''
try:
from functools import reduce
except:
@shyang
shyang / dropbox.py
Created May 6, 2012 07:18
解决Dropbox中国无法及时自动同步的问题
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
参考:解决Dropbox中国无法及时自动同步的问题
http://www.chinagfw.org/2012/04/dropbox.html
ping notify17.dropbox.com => 199.47.218.150
/etc/hosts:
@shyang
shyang / parse_full.py
Created May 5, 2012 18:27
Create Softbank and Unified Emoji mapping for iOS.
#! /usr/bin/env python3
'''Create Softbank and Unified Emoji mapping for iOS.'''
# download full.html to same directory first
# curl -O http://www.unicode.org/%7Escherer/emoji4unicode/snapshot/full.html
import re
import sys
@shyang
shyang / convert.py
Created May 5, 2012 18:17
Convert old style separator for new Xcode.
#! /usr/bin/env python3
'''Convert old style separator for new Xcode.'''
import re
import sys
for file in sys.argv:
with open(file, 'rw') as f:
source = f.read()
@shyang
shyang / ZhConversion.php
Created May 5, 2012 17:42
Simple conversion between Simplified and Triditional Chinese.
<?php
/**
* Simplified / Traditional Chinese conversion tables
*
* Automatically generated using code and data in includes/zhtable/
* Do not modify directly!
*
* @file
*/
@shyang
shyang / currentLocations.py
Created May 5, 2012 17:25
Get the localized strings of "Current Location" used by Google Maps on iOS
#! /usr/bin/env python3
'''Get the localized strings of "Current Location" used by Google Maps on iOS'''
# cd /private/var/stash/Applications/Weather.app
# find . -name Localizable.strings -exec plutil -convert json "{}" \;
# find . -name Localizable.strings | xargs python3 currentLocations.py
import sys
import json