Skip to content

Instantly share code, notes, and snippets.

Michael Chen cwchentw

  • Taiwan
Block or report user

Report or block cwchentw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cwchentw
cwchentw / testC.sh
Last active Nov 19, 2019
Test C code with GCC and Clang
View testC.sh
#!/bin/sh
# Author: Michael Chen License: MIT
program="$0"
version="0.1.1"
version () {
echo $version
}
@cwchentw
cwchentw / testObjC.sh
Last active Nov 19, 2019
Test Compiler Compatibility for Objective-C code
View testObjC.sh
#!/bin/sh
# Author: Michael Chen License: MIT
program="$0"
version="0.2.1"
version () {
echo $version
}
@cwchentw
cwchentw / yahoo-finance-promise.js
Last active Oct 27, 2019
Yahoo Finance Crawler in Puppeteer, Promise Version
View yahoo-finance-promise.js
/* Author: Michael Chen; License: MIT */
const fs = require('fs');
const path = require('path');
const puppeteer = require('puppeteer');
const delay = function (ms) {
return new Promise(function (resolve) {
setTimeout(resolve, ms);
});
};
@cwchentw
cwchentw / yahoo-finance-async.js
Last active Oct 27, 2019
Yahoo Finance Crawler in Puppeteer, Async Version
View yahoo-finance-async.js
/* Author: Michael Chen; License: MIT */
const fs = require('fs');
const path = require('path');
const puppeteer = require('puppeteer');
const delay = function (ms) {
return new Promise(function (resolve) {
setTimeout(resolve, ms);
});
};
@cwchentw
cwchentw / fetchTAIEX.py
Created Apr 26, 2019
TAIEX web crawler
View fetchTAIEX.py
#!/usr/bin/env python
##############################################################################
# fetchTAIEX.py #
# #
# Requirements #
# #
# - Python 3 #
# - Selenium package for Python #
# - The web driver for Chrome #
@cwchentw
cwchentw / zhConvert.js
Last active Feb 9, 2019
Convert from zh-TW to zh-CN (Apache 2.0)
View zhConvert.js
document.addEventListener("DOMContentLoaded", function () {
var isSimplifiedChinese = function (lang) {
var l = lang.toLowerCase();
return l === "zh-cn" || l === "zh_zn" ||
l === "zh-sg" || l === "zh_sg" ||
l === "zh-hans" || l === "zh_hans" ||
l === "zh";
};
@cwchentw
cwchentw / text.md
Created Nov 13, 2018 — forked from ukyo/text.md
mallocとfreeだけ使いたい
View text.md

wasmのメモリ管理つらい問題

とりあえずmallocとfreeがあればokなんだが・・・。

解決策1 emscripten使う

  • pros: 何も考えなくてもmallocとfreeが手に入る。
  • cons: でかい。

解決策2 https://github.com/dcodeIO/webassembly から取り出す

@cwchentw
cwchentw / integer.c
Last active Nov 4, 2019
Generic Queue in Void Pointer (Apache 2.0)
View integer.c
#include <stdbool.h>
#include <stdlib.h>
#include "integer.h"
struct int_t {
int data;
};
int_t* int_new(int n)
{
@cwchentw
cwchentw / fetchCurrencyData.py
Created Oct 21, 2018
ESun Bank Forex Historical Data Crawler as a Python script
View fetchCurrencyData.py
#!/usr/bin/env python
##############################################################################
# fetchCurrencyData.py #
# #
# Requirements #
# #
# - Python 3 #
# - Selenium package for Python #
# - The web driver for Chrome #
@cwchentw
cwchentw / fetchForeclosureData.py
Created Oct 14, 2018
Taiwan Foreclosure Data Crawler as a Python script
View fetchForeclosureData.py
#!/usr/bin/env python
##############################################################################
# fetchForeclosureData.py #
# #
# Requirements #
# #
# - Python 3 #
# - Selenium package for Python #
# - The web driver for Chrome #
You can’t perform that action at this time.