Skip to content

Instantly share code, notes, and snippets.

View mashihua's full-sized avatar
🏠
Working from home

Shihua Ma mashihua

🏠
Working from home
View GitHub Profile
@mashihua
mashihua / hackcmb.js
Created December 2, 2011 22:02
Enable mobile CMB on desktop Safari
SubmitControl.prototype.submit = function() {
var sXmlReq = "";
if (BSGetElementIgnoreError("TransID_New") != null) {
this.addFieldByElementId("TransID_New");
}
for (var i = 0; i < this.m_fields.length; i++) {
var sName = (this.m_fields[i])[0];
var sValue = (this.m_fields[i])[1];
if ((sName != null) && (sValue != null)) {
sValue = sValue.replace("%", "%25");
@mashihua
mashihua / node_debian_init.sh
Created October 19, 2011 07:34 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@mashihua
mashihua / LICENSE.txt
Created May 19, 2011 19:35 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
Copyright (c) 2011 YOUR_NAME_HERE, YOUR_URL_HERE
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@mashihua
mashihua / LICENSE.txt
Created May 19, 2011 19:31 — forked from madrobby/LICENSE.txt
Functional array sorting
Copyright (c) 2011 Thomas Fuchs, http://mir.aculo.us
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: