Skip to content

Instantly share code, notes, and snippets.

View ollyja's full-sized avatar

Chunlei ollyja

View GitHub Profile
@ollyja
ollyja / binarySearchTree.py
Created March 11, 2018 04:37 — forked from jakemmarsh/binarySearchTree.py
a simple implementation of a Binary Search Tree in Python
class Node:
def __init__(self, val):
self.val = val
self.leftChild = None
self.rightChild = None
def get(self):
return self.val
def set(self, val):
select menu_name, stock_qty, total_sold from ti_menus where total_sold > 0 and subtract_stock >0 and stock_qty < 10 and menu_status > 0 INTO OUTFILE '/tmp/menus.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
window.i18n = window.i18n || {};
i18n._langCache = {}
i18n._availableLangs = [
'en',
'zh-TW',
'ja'
]
@ollyja
ollyja / wechat_amr_wav.py
Created April 7, 2017 03:29
convert weichat amr audio files into wav
# WeChat aud file converter to wav files
# Dependencies:
# SILK audio codec decoder (available at https://github.com/gaozehua/SILKCodec)
# ffmpeg
#
# By Gabriel B. Nunes (gabriel@kronopath.net)
# Adapted from another script by Nicodemo Gawronski (nico@deftlinux.net)
#
# update by ollyja
@ollyja
ollyja / git-branches-by-commit-date.sh
Last active March 24, 2016 22:11 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@ollyja
ollyja / tbdba-restore-mysqldump.pl
Last active September 10, 2015 05:36 — forked from sennajox/tbdba-restore-mysqldump.pl
A copy of tbdba-restore-mysqldump.pl
#!/usr/bin/perl
# First written by orczhou.com orchzou@gmail.com
# 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; version 2 of the License.
# How faster it is:
# $ls -lh backup.sql.gz
# -rw-r--r-- 1 mysql dba 14G Nov 21 04:49 backup.sql.gz
@ollyja
ollyja / gist:8c5028d1ecbf012d91b3
Created May 9, 2015 02:43
max value in group subquery
http://stackoverflow.com/questions/7745609/sql-select-only-rows-with-max-value-on-a-column

Gearman can be installed on Windows through cygwin.

Install Cygwin packages

Install cygwin packages (through setup.exe):

  • gcc
  • make
  • libuuid1-devel
  • libiconv

G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.

However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P

demo

They say the following about their Captcha: