Skip to content

Instantly share code, notes, and snippets.

View kylexlau's full-sized avatar

kylexlau kylexlau

  • China, Guangzhou
View GitHub Profile
@kylexlau
kylexlau / del_empty_dirs.py
Created January 6, 2012 05:31
Python delete empty directories, recursive algorithm
import os
def del_empty_dirs(s_dir,f):
b_empty = True
for s_target in os.listdir(s_dir):
s_path = os.path.join(s_dir, s_target)
if os.path.isdir(s_path):
if not del_empty_dirs(s_path):
b_empty = False
@kylexlau
kylexlau / count_file.bat
Created March 4, 2011 07:10
count how many files in a directory at windows
:top
@Echo off&title wkdxz @ BAT-GO At:2010-09-19 12:23:59
echo 统计中......
set cdir=D:\E3SDC\send\data\M10
for /f "delims=" %%a in ('dir /s/b/a-d %cdir%') do set/a a+=1
for /f "delims=" %%a in ('dir /s/b/ad %cdir%') do set/a b+=1
cls&set /p=【%cdir%】文件夹内有 %b% 个文件夹, %a% 个文件,<nul
set a=0
set b=0
timeout /T 3 /NOBREAK
@kylexlau
kylexlau / job168.php
Created August 13, 2009 01:43
job168.com auto login
<?php
// Auto login to job168.com and refresh resume.
$username="kylexlau";
$password="******";
$jcookie="./jcookie";
$ch = curl_init();
$option = array(
CURLOPT_URL => 'http://www.job168.com/person/logon.jsp',
@kylexlau
kylexlau / picasa_up.py
Created July 10, 2009 14:55
upload photos to google picasa
#!/usr/bin/python
# upload photos to google picasa
import gdata.photos.service
import getpass
import socket
import glob
import sys
import os
{
/*
http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
property list: NeXT text, XML file
string, list, dictionary; key-value pairs
"@t" = Command-t
"^t" = Control-t
"~t" = Option-t
@kylexlau
kylexlau / proxy.pac.js
Created July 4, 2009 02:34
auto proxy javascript codes.
function FindProxyForURL(url, host)
{
var domain_list = [
// "wikipedia.org",
"blogspot.com",
"wordpress.com",
"flickr.com",
"feedburner.com",
"v2ex.com",
"vox.com"