Skip to content

Instantly share code, notes, and snippets.

View mnjul's full-sized avatar

Min-Zhong "John" Lu mnjul

View GitHub Profile
// Apache License: https://www.apache.org/licenses/LICENSE-2.0
// For LESS version > 3.0.0, please turn on a flag to enable inline JavaScript:
// http://lesscss.org/usage/#less-options-enable-inline-javascript-deprecated-
.uniform-transition(...) {
transition: ~`(function(lessArgsStr){
var lessArgs = lessArgsStr.substr(1, lessArgsStr.length - 2).split(','); // Or use regexp
return lessArgs
.splice(1)
// Apache License: https://www.apache.org/licenses/LICENSE-2.0
;(function (exports){
// class -> class private methods name Set()
let classPrivateMethodsMap = new WeakMap();
// classPrivateMethods -> WeakMap (instance -> members)
let privateMemberMap = new WeakMap();
// Apache License: https://www.apache.org/licenses/LICENSE-2.0
;(function (exports){
// classPrivateMethods -> WeakMap (instance -> members)
let privateMemberMap = new WeakMap();
function createInternalFunction(classPrivateMethods) {
if (!privateMemberMap.has(classPrivateMethods)) {
privateMemberMap.set(classPrivateMethods, new WeakMap());
@mnjul
mnjul / thread-local-scope-test.py
Created May 27, 2016 01:19
Python Thread Local Storage "global instantiation" vs "thread-local accessing"
# python 2.7.6
import threading
import sys
import traceback
import random
# too lazy to properly turn off output buffering
def msg(msg):
sys.stderr.write(msg)
@mnjul
mnjul / console.py
Created August 27, 2015 23:40
console.log() in Python
# Just for fun.
from __future__ import print_function
class console():
@staticmethod
def log(*args):
print(*args)
'use strict';
// put this Node JS file in ./gaia/apps/keyboard/ and run.
// this script iterates through and parses layout js files and lists if
// we support a specific keyboard layout, which IMEngine that layout uses,
// and if dictionary is available (by this auto correction and prediction works)
let fs = require('fs');
diff --git a/build/config/phone/apps-engineering.list b/build/config/phone/apps-engineering.list
index ef3ac1e..0cf313f 100644
--- a/build/config/phone/apps-engineering.list
+++ b/build/config/phone/apps-engineering.list
@@ -16,6 +16,7 @@ dev_apps/test-agent
dev_apps/test-container
dev_apps/test-iac-publisher
dev_apps/test-iac-subscriber
+dev_apps/test-keyboard-app
dev_apps/test-otasp
@mnjul
mnjul / pull.sh
Last active August 29, 2015 14:04
Pull & Extract / Pack & Push omni.ja from/to FxOS phone
adb pull /system/b2g/omni.ja
rm -rf omni.old
mv omni omni.old
mkdir omni
mv omni.ja omni
cd omni
unzip omni.ja
rm omni.ja
cd ..