Skip to content

Instantly share code, notes, and snippets.

View evanxd's full-sized avatar

Evan Tseng evanxd

View GitHub Profile
@evanxd
evanxd / proposal-of-iotjs.md
Last active May 2, 2019 01:38
Proposal of IoT.js

Proposal of IoT.js

[IoT.js][iotjs] is an open framework for building IoT applications quickly and easily. The goal is to fascilitate an open IoT ecosystem in which contributors will build components which will in turn be used in other components and applications. IoT.js and these components will be built using Open Web technologies and philosophies. The purpose of this document is to explain why I feel it is of great importance for Mozilla to invest their time and resources into this project.

IoT Is The Next Big Thing

It is common knowledge at this point that within the next 5-10 years, a very large percentage of consumer, comercial and industrial products will be IoT enabled. According to conservative estimates ([chart][iot-device-number-chart]) there will be [50.1 billions connected devices][iot-device-number] in the world by 2020.

Because of this, I strongly feel that the next frontier for Mozilla as a company will be to get involved with IoT so that it can become the standard bearer. At the moment

@evanxd
evanxd / chrome-migration-utils-usage.js
Created November 15, 2017 07:20
Usage of ChromeMigrationUtils helper functions
Cu.import("resource:///modules/ChromeMigrationUtils.jsm");
(async function () {
console.log(await ChromeMigrationUtils.getExtensionList());
} ());
@evanxd
evanxd / spotlight-plan.md
Last active October 17, 2017 03:02
Firefox Preferences Spotlight Technical Plan
@evanxd
evanxd / visual-refresh-work.md
Created June 28, 2017 22:06
Visual Refresh Work

Visual Refresh

  • Font family, size, color
  • Background color
  • Margin size
  • Web components (checkbox, radio button, input field, button, dropdown menu)
  • Update and add icons/images
    • menu
    • firefox account
    • Bug 1357308: [meta] Add content and images on sub-pages in Preferences
  • Subdialogs (need detail info)
@evanxd
evanxd / mozconfig
Created May 8, 2017 20:03
The mozconfig file for building whole Firefox.
# Define where build files should go. This places them in the directory
# "obj-ff-dbg" under the current source directory
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
# Enable debug builds
ac_add_options --enable-debug
@evanxd
evanxd / mqtt-hook.md
Last active March 22, 2017 07:29
MQTThook

MQTThook

It is a [MQTT][mqtt] version of [Webhook][webhook] for IoT devices. It helps MQTT-based IoT devices use automation services (e.g. [IFTTT][ifttt] or [Zapier][zapier]) to interact with existed Web applications/services and enrich its capability.

Sample Code

Initialize a MQTThook instance.

var MQTThook = require('mqtthook');
var mqtthook = new MQTThook('mqtt://test.mosquitto.org');
@evanxd
evanxd / readability-js-plan.md
Created January 23, 2017 08:06
Readability.js Plan

Readability.js Plan

Engineering

Make Readability.js more reliable and modularized.

  • Make reader mode button show for top websites.
  • Make reader mode result (more) correct for top websites.
  • Build/refactor reader mode feature as a WebExtensions extension.

Features

Build new features with Readability.js or enhance Reader Mode feature on Firefox.

@evanxd
evanxd / bug-1255978-1.html
Created November 15, 2016 09:54
The List Contains Lots Of Paragraphs Of Text
<ul class="legends">
<li data-gallery-legend="1">
<h2>
<span class="counter">1/50</span>
<!-- Optional photo title -->
United goin down </h2>
<!-- Optional photo caption -->
<p>Manchester United's absence from the Champions League hurt more than the fans' pride last year - it also dented the bottom line. Revenues at the New Uork listed club dipped 8.8 per cent to £395.2m in the year to June, triggering a £1.2 million loss after broadcasting and sponsorship deals dried up. The club said it was now looking to raise $400m from a share issue.</p>
<!-- Optional photo credits -->
<p class="credits">GETTY IMAGES</p>
@evanxd
evanxd / get-expected-result.js
Created November 4, 2016 08:14
Get Expected Result of Readability.js
require("fs").writeFileSync(__dirname + "/test-pages/bug-1173823/expected.html", result.content);
@evanxd
evanxd / opendata-sample.js
Created October 28, 2016 04:07
Sample Code for Querying Data by Date
window.query = (data) => {
return data.filter(function(item) {
return new Date(item.date) > new Date('2016/10/28 11:23:00') &&
new Date(item.date) < new Date('2016/10/28 11:24:00');
});
};