Skip to content

Instantly share code, notes, and snippets.

View fillano's full-sized avatar

Hsu Ping Feng fillano

View GitHub Profile
@fillano
fillano / test786.html
Created August 21, 2012 02:55
simple shared whiteboard with canvas and websocket
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<style>
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@fillano
fillano / offline test
Created November 5, 2010 06:21
簡單的離線應用測試,參考http://www.fillano.idv.tw/test642.html
<!DOCTYPE html>
<html lang="zh-TW" manifest="test642.manifest">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<script src="test642.js"></script>
</head>
<body>
<input type="button" value="game" id="game"><input type="button" value="update" id="update">
<div id="data"></div>
<div id="panel"></div>
@fillano
fillano / index.html
Created August 7, 2020 09:16
zip file parser in js (with inflate provided by pako)
<!DOCTYPE html>
<html>
<head>
<title>file reader</title>
<style>
.dropable {
width: 100%;
height: 100px;
background-color: #369;
test10();
// 一般階乘
function test1() {
console.log(fact(5));
function fact(n) {
return n < 2 ? 1 : n * fact(n-1);
}
}
@fillano
fillano / index.js
Created August 13, 2020 01:31
convert xml to simple json
const xmlrun = require('xmlrun');
const fs = require('fs');
const args = require('minimist')(process.argv.slice(2));
main(args);
function main(args) {
if(args._.length > 0) {
fs.readFile(args._[0], 'utf8', (err, data) => {
if(!!err) return console.log(err);
@fillano
fillano / xmlrun.js
Last active August 6, 2020 08:53
poc to build an object tree then run.
const args = require('minimist')(process.argv.slice(2));
const DOMParser = require('xmldom').DOMParser;
const fs = require('fs');
main(args);
function main(args) {
if(args._.length > 0) {
read(args._[0])
.then(body => {
1. 什麼是Serverless
2. 簡介AWS Lambda服務
3. 用API Gateway架構API服務
4. 資料儲存的考量
5. 靜態頁面的考量
6. 使用S3
7. 開始架構
8. IAM
9. 存放在Lambda的node.js環境
10. 撰寫程式的要點
@fillano
fillano / test001.php
Last active September 11, 2018 09:28
a simple event facilities test.
<?php
class Event {
private static $events = [];
public static function Regist($eventName, Callable $callback) {
if(!is_callable($callback)) return false;
if(!array_key_exists($eventName, self::$events)) {
self::$events[$eventName] = [];
}
self::$events[$eventName][] = $callback;
return true;
@fillano
fillano / mod1.js
Created June 8, 2017 09:35
create class with readonly attribute.
const t = Symbol('ttt');
module.exports = class {
constructor(name) {
this[t] = name;
}
get name() {
return this[t];
}
sayHello() {
@fillano
fillano / pptx_data_structure.md
Last active January 4, 2017 06:26
simple pptx data structure reference