Skip to content

Instantly share code, notes, and snippets.

VoiceOver Bug Report

Description

VoiceOver in Cantonese is unable to speak the pattern /百分之[0-9]+/, i.e. Chinese percentage, e.g. "百分之10", "百分之20", "百分之1000", etc.

Procedures to reproduce

  1. Change Language to 繁體中文 (Traditional Chiense)
@lacek
lacek / Spring JNDI Data Source.md
Last active August 29, 2015 14:24
Specify data source using JNDI resource in Spring

Setting:

  • Ubuntu 14
  • Tomcat 7
  • Spring 3
  • MySQL 5.6

Install JDBC connector

#!/usr/bin/env python
import gevent
from gevent.threadpool import ThreadPool
from random import randint
def worker(id):
print('worker %d working...' % (id))
time = randint(1, 5)
gevent.sleep(time)
Windows Registry Editor Version 5.00
; Solarized Dark Color Scheme for PuTTY
; https://github.com/altercation/solarized/tree/master/putty-colors-solarized
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]
"Colour0"="131,148,150"
"Colour1"="147,161,161"
"Colour2"="0,43,54"
"Colour3"="7,54,66"
@lacek
lacek / update-jenkins.sh
Created August 23, 2015 14:36
Update Jenkins on Mac OS X
#!/bin/bash
DEFAULT_URL=http://updates.jenkins-ci.org/current/latest/jenkins.war
TMP_PATH=/tmp/jenkins.war
APP_PATH=/Applications/Jenkins/jenkins.war
PLIST_PATH=/Library/LaunchDaemons/org.jenkins-ci.plist
url=${1-$DEFAULT_URL}
echo 'Downloading WAR package...'

Convert MP4 to WMV on MacOS

Install ffmpeg

  1. Open Spotlight:

    Open Spotlight

  2. Search Terminal and press enter:

@lacek
lacek / csv_line.sh
Last active October 31, 2017 03:15
#!/bin/bash
show_help()
{
cat <<EOB
Usage: ${0##*/} [-h] [-t sep] [-n num] file
Display a row in CSV file with header vertially.
Options:
-t specify field separator, default is tab
-n specify line to show, default is 1
@lacek
lacek / mp_queue.py
Last active August 23, 2018 02:59
Pythhon multiprocessing with queue
#!/usr/bin/env python2.7
# single producer-multiple consumer parallelism using a queue
from ctypes import c_bool
import logging
import multiprocessing as mp
import time
TASK_END = 'TASK_END'
NUM_CONSUMERS = 2
NUM_TASKS = 4
@lacek
lacek / .screenrc-main-example
Last active December 11, 2018 07:07 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - [email protected]
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@lacek
lacek / convert_cookies.py
Created April 11, 2019 09:24
Converts cookie JSON exported from EditThisCookie to formats for wget/curl
#!/usr/bin/env python2.7
from __future__ import print_function
import argparse
import json
import sys
parser = argparse.ArgumentParser(
description='Converts cookie JSON exported from EditThisCookie to formats for wget/curl')
parser.add_argument('-f', '--format', choices=('netscape', 'curl',),
default='netscape', help='Output format')