Skip to content

Instantly share code, notes, and snippets.

View ShuaiyiWu's full-sized avatar

Shuaiyi Wu ShuaiyiWu

View GitHub Profile
@ShuaiyiWu
ShuaiyiWu / unicode_csv.py
Created April 21, 2017 08:06 — forked from hvtuananh/unicode_csv.py
Python Unicode CSV Reader/Writer (fix writerow problem in Python docs)
#http://docs.python.org/2.7/library/csv.html
import csv, codecs, cStringIO
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)
@ShuaiyiWu
ShuaiyiWu / Avocado.ps1
Last active July 20, 2016 05:56
Customized script
param (
[parameter(mandatory=$true)]
[hashtable]$ParameterDictionary
)
# Main
$source = $($MyInvocation.MyCommand.Definition)
$lineNumber = $($Myinvocation.ScriptlineNumber)
$reportFilePath = $ParameterDictionary.environment.logFile
@ShuaiyiWu
ShuaiyiWu / Test.c
Created January 31, 2016 05:17
test
#include <stdio.h>