Search

11/27/2018

memo

weekly memo(work)
--------
http://shopping.pchome.com.tw/?m=item&f=exhibit&IT_NO=AMAA1F-A23162965-000&SR_NO=AMAA1F
修改select down graceful - index
2. long 跳線 往路線, 2.5吋硬碟
3. 查南非幣定存
1. SMTP setting http://backyard.yahoo.com/resources/isnet/self_support/smtp.htm
2. a extremely fast file format checker in C
http://www.itee.uq.edu.au/~cristina/students/david/honoursThesis96/bff.htm
http://www.iwriteiam.nl/Ha_HTCABFF.html
3. a blooger new theme http://jszen.blogspot.com/2005/03/cross-domain-security-woes.html
4. googlex and message board backend
5. check out XFN
http://microformats.org/wiki/xfn-implementations
weekly memo(home)
* survey javascript iamge rotation
nifty cube
http://www.html.it/articoli/niftycube/index.html
像簿的style
http://www.guardian.co.uk/news/gallery/2007/jul/18/china.pollution?picture=330216015
* slideshow 加上空白鍵

,handleKeypress: function(event){
var key = String.fromCharCode(event.charCode ? event.charCode : event.keyCode);
if(!slideshow._paused) return;

* handleKepress 的 Esc keycode?
* check out YUI moton
* edit Wiki about IE debug
* http://ued.taobao.com/blog/2008/01/10/css-notes-7-input-form/#comment-26556
* http://ejohn.org/blog/super-fast-delicious-bookmarklet/
* http://ejohn.org/blog/building-a-javascript-library/
* a yahoo! dictionary bookmarklet & review the old bookmarklet
* a bookmarlet that include firebug-lite for ie use | improve jash
* watch : the 25th hour
* alert prompt confirm window http://extjs.com/deploy/dev/examples/message-box/msg-box.html
* checkout ext
http://extjs.com/deploy/dev/examples/
* watch: The Man who wasn't there
http://developer.yahoo.com/yui/connection/#scope
* read http://blog.ericsk.org/archives/815 用 Python + django 10分鐘內作出一個 blog at ericsk’s blog
* build a calendar picker according to the nexus solution
* a light-weight getRegion & getXY without library
* read 为之漫笔
* read Vitamin Features » 15 Things you can do with Yahoo! UI
http://www.thinkvitamin.com/features/javascript/15-things-you-can-do-with-yahoo-ui
* read Vitamin Features » The Importance of Maintainable JavaScript
* read Information Architects Japan » iA Notebook » Web Design is 95% Typography (1)
http://www.informationarchitects.jp/ia-notebook
John Resig - Simple "Class" Instantiation
* read
http://livepipe.net/projects/event_behavior/
http://www.adamlogic.com/2007/03/20/3_metaprogramming-javascript-presentation

monthly memo

project & idea
* my own javascript debug library -> read AdvancED.DOM.Scripting / A practical example: your own debugging log
* rewrite genTitle() to avoid javascript error

* read 最新JavaScript動態網頁範例 ch8 頁框的問題
* try http://foo.com/bar.htm#test/many many after ....
* check the ajaxian about the above-mentioned techniques

5/21/2015

HelloFax:免費線上傳真服務(每月都有50頁額度) @ 符碼記憶

HelloFax:免費線上傳真服務(每月都有50頁額度) @ 符碼記憶

一般而言我們平常應該沒有什麼傳真的需求, 不過臨時有需要時就很頭大,雖然郵局、便利商店都有提供傳真服務, 可是應該還是有人像我一樣,若能省錢就省錢,能不用出門就不用出門吧 :p 這次研究免費線上傳真服務是因為需要傳真申請華南信用卡紅利點數兌換ANA哩程, 研究了幾種免費服務後最後選擇了 HelloFax,簡單整理比較如下: HelloFax:測試OK,簡單好用,每月有50頁額度,全台可傳! MyFax:傳真後需收email點連結才真正送出,但12/4測試收不到email FaxDesk:已陣亡,連不到網頁

5/20/2015

Himelight - 履歷產生器

Himelight - 履歷產生器

打造屬於新世代的個人品牌 Himelight 讓你可以輕鬆的完成出色履歷,還可以點亮你經歷最精采的部份,展現給全世界。

Meaning of the phrase "it is worth noting that" - English Language & Usage Stack Exchange

Meaning of the phrase "it is worth noting that" - English Language & Usage Stack Exchange

"It is worth noting that" simply means "here's something, which you should remember:" or "here's something you should pay attention to:" or "here's something that is worth reading and remember:" ex: It’s worth nothing that while `setTimeout` is relatively portable across platforms, there’s often a better alternative available.

4/23/2015

IRHydra

IRHydra

This is a tool that can display intermediate representations used by V8 and Dart VM optimizing compilers.

4/21/2015

youtube-dl - CLI tool to get videos from YouTube - Pank's Blog

youtube-dl - CLI tool to get videos from YouTube - Pank's Blog

youtube-dl 是個強大的線上影片下載工具, 不止支援 YouTube, 也支援很多其他站 (如土豆、樂視等) 也有提供 Windows 版 (已包入 Python) 列出所有 format code youtube-dl -F https://www.youtube.com/watch?v=ajLsb3QvwbI 指定下載某個 format code youtube-dl -f 266 https://www.youtube.com/watch?v=ajLsb3QvwbI 下載最高解析度 youtube-dl -f bestvideo+bestaudio https://www.youtube.com/watch?v=ajLsb3QvwbI

4/20/2015

haxorplatform/web-bundle

haxorplatform/web-bundle

Tool to pack binary files into a PNG image.

4/15/2015

workaround: video auto play in mobile browser

Media playback restrictions in Blink | Philip Jägenstedt

However, I’ve also found a workaround for current browsers. As of WebKit r108831, all restrictions are removed in the first successful load() or play() call. Any user gesture is accepted, so one can listen to all input events and remove the restrictions as soon as the user clicks, touches or uses the keyboard. One does not need to start playback at that point, but can wait until a later time. For example, one could “liberate” a number of audio elements for later use in a game. I’ve prepared a demo of the workaround. It works in current versions of Opera, Chrome and Safari. While it does not work in the default Android browser prior to KitKat, even there it could be adapted to e.g. autoplay background music by calling play() instead of load() in the input event handler.

Napkin for OS X - Say it with a picture, skip the 1,000 words

Napkin for OS X - Say it with a picture, skip the 1,000 words

Napkin is the ideal image markup application for OS X. Designers, software developers, artists, educators, journalists, or anyone that needs to annotate images will love how painless and powerful Napkin is. You'll be creating engaging results in no time. Watch our quick video to see how Napkin will make your life easier.

2/26/2015

Aero Snap 工具加強版:BetterSnapTool | AppleUser

Aero Snap 工具加強版:BetterSnapTool | AppleUser

via: Amethyst – A tiling window manager for OS X | Hacker News

7 Rules for Creating Gorgeous UI

7 Rules for Creating Gorgeous UI (Part 1) — Medium

Light comes from the sky Black and white first Double your whitespace Learn the methods of overlaying text on images (see Part 2) Make text pop— and un-pop (see Part 2) Only use good fonts (see Part 2) Steal like an artist (see Part 2)

2/25/2015

HandBrake: Open Source Video Transcoder

HandBrake: Open Source Video Transcoder

Convert video from nearly any format Free and Open Source Multi-Platform (Windows, Mac and Linux)

Retrieving tabs after Chrome crash:chrome

Retrieving tabs after Chrome crash:chrome

First go to ~/Library/Application Support/Google/Chrome/Default and look for all the variants of current session, current tabs, last session, last tabs. You can rename last tabs (make backups first) to current tabs, and then boot chrome, and it will try to restore. Chromes tab backups are terrible. I recommend installing Fresh Start or another backup solution from the chrome web store.
chrome extention: Session Buddy
Session Buddy is a session manager for your browser that allows you to: ● See all open tabs in one place. ● Save open tabs and restore them later. Great for freeing up memory and avoiding tab clutter. ● Recover open tabs after a browser or system crash. ● Organize links by topic and find them when you need them with keyword search. ● Easily consolidate link sets and eliminate duplicates. ● Export link sets in a variety of text formats for use in email messages, documents, spreadsheets, and online posts.
chrome extention: FreshStart
*How to use Saves all your windows and tabs every minutes. Recommended: 5 minutes. Auto-saving too frequently may slow down your machine.

1/22/2015

Functional Programming in Javascript === Garbage « Thomas Reynolds

Functional Programming in Javascript === Garbage « Thomas Reynolds

These can both be written as a reducer.
function map(f, list) {
  return reduce(function(val, sum) {
    sum.push(f(val));
    return sum;
  }, list, []);
}
The reducer takes a function which can update a value sum which starts at [] and is updated once for each item in the list. Okay, that was a long lead in. Here's how you could naively implement a reducer:
function reduce(f, list, sum) {
  if (list.length < 1) {
    return sum;
  } else {
    var val = list.shift();
    return reduce(f, list, f(val, list));
  }
}

Javascript in 2015 - YouTube

1. npm install -g jspm 2. cd ~/dev/jspm; jspm init 3. npm install -g live-server 4. live-server . 5. vim index.htm, add 6. vim ./lib/main.js, add import RedditApi from './Reddit-api' export default {} 7. vim ./lib/Reddit-api.js, add class RedditApi { load() { console.log('todo') } } export default new RedditApi() 8. jspm install npm:jsonp 9. jspm bundle --minify lib/main
tag: systemJS

1/21/2015

live-server

live-server

This is a little development server with live reload capability. Use it for hacking your HTML/JavaScript/CSS files, but not for deploying the final site. ex: PORT=12345 live-server .

12/15/2014

Synergy - Mouse and keyboard sharing software

Synergy - Mouse and keyboard sharing software

Synergy combines your devices together in to one cohesive experience. Seamlessly move your mouse to any computer and start typing. Works on all major operating systems (Windows, Mac OS X, and Linux). Share your clipboard (copy and paste) between your computers. Drag and drop files from one computer to another (Windows and Mac OS X). Encryption keeps sensitive data safe on public networks. Network-based (IP) software KVM switch (non-video).

12/10/2014

About BNF notation

About BNF notation

What is BNF notation? BNF is an acronym for "Backus Naur Form". John Backus and Peter Naur introduced for the first time a formal notation to describe the syntax of a given language (This was for the description of the ALGOL 60 programming language, see [Naur 60]). To be precise, most of BNF was introduced by Backus in a report presented at an earlier UNESCO conference on ALGOL 58. Few read the report, but when Peter Naur read it he was surprised at some of the differences he found between his and Backus's interpretation of ALGOL 58. He decided that for the successor to ALGOL, all participants of the first design had come to recognize some weaknesses, should be given in a similar form so that all participants should be aware of what they were agreeing to. He made a few modificiations that are almost universally used and drew up on his own the BNF for ALGOL 60 at the meeting where it was designed. Depending on how you attribute presenting it to the world, it was either by Backus in 59 or Naur in 60. (For more details on this period of programming languages history, see the introduction to Backus's Turing award article in Communications of the ACM, Vol. 21, No. 8, august 1978. This note was suggested by William B. Clodius from Los Alamos Natl. Lab). Since then, almost every author of books on new programming languages used it to specify the syntax rules of the language. See [Jensen 74] and [Wirth 82] for examples. The following is taken from [Marcotty 86]: The meta-symbols of BNF are: ::= meaning "is defined as" | meaning "or" < > angle brackets used to surround category names. The angle brackets distinguish syntax rules names (also called non-terminal symbols) from terminal symbols which are written exactly as they are to be represented. A BNF rule defining a nonterminal has the form: nonterminal ::= sequence_of_alternatives consisting of strings of terminals or nonterminals separated by the meta-symbol | For example, the BNF production for a mini-language is: ::= program begin end ; This shows that a mini-language program consists of the keyword "program" followed by the declaration sequence, then the keyword "begin" and the statements sequence, finally the keyword "end" and a semicolon. (end of quotation)

12/05/2014

ServiceWorker/explainer.md at master · slightlyoff/ServiceWorker

ServiceWorker/explainer.md at master · slightlyoff/ServiceWorker

ServiceWorkers Explained What's All This Then? The ServiceWorker is like a SharedWorker in that it: runs in its own thread isn't tied to a particular page has no DOM access Unlike a SharedWorker, it: can run without any page at all can terminate when it isn't in use, and run again when needed has a defined upgrade model HTTPS only (more on that in a bit) We can use ServiceWorker: to make sites work faster and/or offline using network intercepting as a basis for other 'background' features such as push messaging and background sync Getting Started First you need to register for a ServiceWorker: if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/my-app/sw.js', { scope: '/my-app/' }).then(function(reg) { console.log('Yey!', reg); }).catch(function() { console.log('Boo!', err); }); } In this example, /my-app/sw.js is the location of the ServiceWorker script, and it controls pages whose URL begins /my-app/. The scope is optional, and defaults to /. .register returns a promise. If you're new to promises, check out the HTML5Rocks article. Some restrictions: The registering page must have been served securely (HTTPS without cert errors) The ServiceWorker script must be on the same origin as the page, although you can import scripts from other origins using importScripts …as must the scope HTTPS only you say? Using ServiceWorker you can hijack connections, respond differently, & filter responses. Powerful stuff. While you would use these powers for good, a man-in-the-middle might not. To avoid this, you can only register for ServiceWorkers on pages served over HTTPS, so we know the ServiceWorker the browser receives hasn't been tampered with during its journey through the network. Github Pages are served over HTTPS, so they're a great place to host demos. Initial lifecycle Your worker script goes through three stages when you call .register: Download Install Activate You can use events to interact with install and activate: self.addEventListener('install', function(event) { event.waitUntil( fetchStuffAndInitDatabases() ); }); self.addEventListener('activate', function(event) { // You're good to go! }); You can pass a promise to event.waitUntil to extend the installation process. Once activate fires, your ServiceWorker can control pages! So I'm controlling pages now? Well, not quite. A document will pick a ServiceWorker to be its controller when it navigates, so the document you called .register from isn't being controlled, because there wasn't a ServiceWorker there when it first loaded. If you refresh the document, it'll be under the ServiceWorker's control. You can check navigator.serviceWorker.controller to see which ServiceWorker is in control, or null if there isn't one. Note: when you're updating from one ServiceWorker to another, things work a little differently, we'll get onto that in the "Updating" section. If you shift+reload a document it'll always load without a controller, which is handy for testing quick CSS & JS changes. Documents tend to live their whole life with a particular ServiceWorker, or none at all. However, a ServiceWorker can call event.replace() during the install event to do an immediate takeover of all pages within scope. Network intercepting self.addEventListener('fetch', function(event) { console.log(event.request); }); You get fetch events for: Navigations within your ServiceWorker's scope Any requests triggered by those pages, even if they're to another origin The means you get to hear about requests for the page itself, the CSS, JS, images, XHR, beacons… all of it. The exceptions are: iframes & <object>s - these will pick their own controller based on their resource URL ServiceWorkers - requests to fetch/update a ServiceWorker don't go through the SerivceWorker Requests triggered within a ServiceWorker - you'd get a loop otherwise The request object gives you information about the request such as its URL, method & headers. But the really fun bit, is you can hijack it and respond differently: self.addEventListener('fetch', function(event) { event.respondWith(new Response("Hello world!")); }); Here's a live demo (you'll need to enable some flags to get it working in Chrome today). .respondWith takes a Response object or a promise that resolves to one. We're creating a manual response above. The Response object comes from the Fetch Spec. Also in the spec is the fetch() method, which returns a promise for a response, meaning you can get your response from elsewhere: self.addEventListener('fetch', function(event) { if (/\.jpg$/.test(event.request.url)) { event.respondWith( fetch('//www.google.co.uk/logos/…3-hp.gif', { mode: 'no-cors' }) ); } }); In the above, I'm capturing requests that end .jpg and instead responding with a Google doodle. fetch() requests are CORS by default, but by setting no-cors I can use the response even if it doesn't have CORS access headers (although I can't access the content with JavaScript). Here's a demo of that. Promises let you fallback from one method to another: self.addEventListener('fetch', function(event) { event.respondWith( fetch(event.request).catch(function() { return new Response("Request failed!"); }) ); }); The ServiceWorker comes with a cache API, making it easy to store responses for reuse later, more on that shortly, but first… Updating a ServiceWorker The lifecycle of a ServiceWorker is based on Chrome's update model: Do as much as possible in the background, don't disrupt the user, complete the update when the current version closes. Whenever you navigate to page within scope of your ServiceWorker, the browser checks for updates in the background. If the script is byte-different, it's considered to be a new version, and installed (note: only the script is checked, not external importScripts). However, the old version remains in control over pages until all tabs using it are gone (unless .replace() is called during install). Then the old version is garbage collected and the new version takes over. This avoids the problem of two versions of a site running at the same time, in different tabs. Our current strategy for this is "cross fingers, hope it doesn't happen". Note: Updates obey the freshness headers of the worker script (such as max-age), unless the max-age is greater than 24 hours, in which case it is capped to 24 hours. self.addEventListener('install', function(event) { // this happens while the old version is still in control event.waitUntil( fetchStuffAndInitDatabases() ); }); self.addEventListener('activate', function(event) { // the old version is gone now, do what you couldn't // do while it was still around event.waitUntil( schemaMigrationAndCleanup() ) }); Here's how that looks in practice. Unfortunately refreshing a single tab isn't enough to allow an old worker to be collected and a new one take over. Browsers make the next page request before unloading the current page, so there isn't a moment when current active worker can be released. The easiest way at the moment is to close & reopen the tab (cmd+w, then cmd+shift+t on Mac), or shift+reload then normal reload. The Cache ServiceWorker comes with a caching API, letting you create stores of responses keyed by request. self.addEventListener('install', function(event) { // pre cache a load of stuff: event.waitUntil( caches.open('myapp-static-v1').then(function(cache) { return cache.addAll([ '/', '/styles/all.css', '/styles/imgs/bg.png', '/scripts/all.js' ]); }) ) }); self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request).then(function(response) { return response || fetch(event.request); }) ); }); Matching within the cache is similar to the browser cache. Method, URL and vary headers are taken into account, but freshness headers are ignored. Things are only removed from caches when you remove them. You can add individual items to the cache with cache.put(request, response), including ones you've created yourself. You can also control matching, discounting things such as query string, methods, and vary headers. Other ServiceWorker related specifications Since ServiceWorkers can spin up in time for events, they've opened up the possibility for other features that happen occasionally in the background, even when the page isn't open. Such as: Push Background sync Geofencing Conclusions This document only scratches the surface of what ServiceWorkers enable, and aren't an exhaustive list of all of the available APIs available to controlled pages or ServiceWorker instances. Nor does it cover emergent practices for authoring, composing, and upgrading applications architected to use ServiceWorkers. It is, hopefully, a guide to understanding the promise of ServiceWorkers and the rich promise of offline-by-default web applications that are URL friendly and scalable. Acknowledgments Many thanks to Web Personality of the Year nominee Jake ("B.J.") Archibald, David Barrett-Kahn, Anne van Kesteren, Michael Nordman, Darin Fisher, Alec Flett, Andrew Betts, Chris Wilson, Aaron Boodman, Dave Herman, Jonas Sicking, and Greg Billock for their comments and contributions to this document and to the discussions that have informed it.
Introduction to Service Worker: How to use Service Worker - HTML5 Rocks