Skip to content

Instantly share code, notes, and snippets.

View marcoleong's full-sized avatar
🐒
productivity--

Marco Leong marcoleong

🐒
productivity--
View GitHub Profile
@marcoleong
marcoleong / test-import
Created July 3, 2015 16:54
Test Import
====== outputScheduler-1 ====== Max rows to process: 284, highest column: AMK
Processing LAT209...
Processing LBA236_GS...
Processing LBA236_SW...
Processing LCO101_GS...
Processing LCO103_GS...
Processing LCO105_SW...
section LCO105_SW/5222 - CANNOT find teacher TBC01
Processing LCO107_SW...
Processing LGS203...
@marcoleong
marcoleong / update-namecheap-ddns
Created July 4, 2015 14:28
Mitrotik Router Dynamic DNS update script for Namecheap DDNS
:log info "NamecheapDDNS: start updating..."
:global ddnspass "yourownddnspass"
:global theinterface "pppoe-out1"
:global ddnshost "subdomain"
:global ddnsdomain "example.com"
:global ipddns [:resolve "$ddnshost.$ddnsdomain"];
:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]
:if ([ :typeof $ipfresh ] = nil ) do={

Keybase proof

I hereby claim:

  • I am marcoleong on github.
  • I am marcoleong (https://keybase.io/marcoleong) on keybase.
  • I have a public key whose fingerprint is D091 CF99 4114 1E51 92C0 6C02 6222 AFC3 65CB C217

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1BWJAGmwniQLu9DpM9X6DM9eEFWpuYRa9e https://explorer.blockstack.org/address/1BWJAGmwniQLu9DpM9X6DM9eEFWpuYRa9e
function receiveLoginUser (user) {
return {type: 'RECEIVE_LOGIN_USER', payload: user}
}
function login (email, password) {
return (dispatch) => {
// 可以呢到再dispatch(loadingLogin(true))
return axios.post("xxxx/login", { email, password }).then(response => {
dispatch(receiveLoginUser(response.user))
@marcoleong
marcoleong / handler.py
Created January 29, 2019 07:34
Kubeless Python Botte response binary file
from bottle import abort, HTTPResponse
def handle(data, event):
headers = dict()
content = # binary content
headers['Content-Type'] = 'image/jpeg'
headers['Content-Disposition'] = 'inline'
headers['Content-Length'] = len(content)