Skip to content

Instantly share code, notes, and snippets.

View gasolin's full-sized avatar

gasolin gasolin

View GitHub Profile

Network Monitor

The Network Monitor(netmonitor) shows you all the network requests Firefox makes (for example, when it loads a page, or due to XMLHttpRequests), how long each request takes, and details of each request.

Prerequisite

/* -*- indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const {LocalizationHelper} = require("devtools/shared/l10n");
const L10N = new LocalizationHelper("devtools/locale/sourceeditor.properties");
@gasolin
gasolin / Vagrantfile
Last active October 12, 2016 02:59
Vagrantfile for elementary OS VM setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
$bootstrap = <<SCRIPT
!/bin/bash
SCRIPT
# To use this script and prepare your build environment, run the following
# command in the same directory as the Vagrantfile.
@gasolin
gasolin / memorize.js
Created August 28, 2016 04:27
memorize.js
// from https://jigsawye.gitbooks.io/mostly-adequate-guide/content/ch3.html
var memorize = function(f) {
var cache = {};
return function() {
var arg_str = JSON.stringify(arguments);
cache[arg_str] = cache[arg_str] || f.apply(f, arguments)
return cache[arg_str];
}
}
function Shape({ x, y }) {
this._x = x;
this._y = y;
}
Shape.prototype = {
get coords() {
return { x: this._x, y: this._y };
},
}
@gasolin
gasolin / panel_test.js
Created October 7, 2015 03:20
just work test sample for bug 1208205, don't take it directly
/* global loadBodyHTML*/
'use strict';
require('/shared/js/component_utils.js');
require('/shared/elements/gaia_radio/script.js');
requireApp('settings/shared/test/unit/load_body_html_helper.js');
requireApp('settings/shared/test/unit/mocks/mock_navigator_moz_settings.js');
suite('Improve browser os panel > ', function() {
var MockSettingsCache;
@gasolin
gasolin / MacAlternative4Win
Last active September 29, 2015 05:34
mac alternative for windows
# crop screen
附屬應用程式 > 剪取工具
# App
* iTerm - cmder
* git - github desktop
* dash - [vilocity](https://velocity.silverlakesoftware.com/)
* nvm - [nvm for windows](https://github.com/coreybutler/nvm-windows)
# Shortcuts
@gasolin
gasolin / switch_flame_memory.sh
Created July 30, 2015 03:23
switch flame memory size
$ adb reboot bootloader
$ fastboot oem mem 319
$ fastboot getvar mem
mem: 319m
$ fastboot reboot
<h3>BMI</h3>
<label for="height">Height(cm)</label>
<input id="height"></input>
<br/>
<label for="weight">Weight(kg)</label>
<input id="weight"></input>
<br/>