Skip to content

Instantly share code, notes, and snippets.

View piroor's full-sized avatar

YUKI "Piro" Hiroshi piroor

View GitHub Profile
/**
* @fileOverview JSDeferred flavoured Promise.jsm
* @author piro.outsider.reflex@gmail.com
* @version 0.1
* @license
* JSDeferred flavoured Promise.jsm Copyright (c) 2014 YUKI "Piro" Hiroshi
* JSDeferred Copyright (c) 2007 cho45 ( www.lowreal.net )
*
* Original: http://github.com/cho45/jsdeferred
*
@piroor
piroor / morkdump
Last active August 29, 2015 14:00
morkdump
#!/usr/bin/env ruby
#
# Mork Dumper, based on the CPAN module "Mozilla::Mork"
# http://search.cpan.org/~kript/Mozilla-Mork-0.01/lib/Mozilla/Mork.pm
#
# description:
# "Mork" is a format of Mozilla's internal data files, like
# summary files (*.msf) of Thunderbird. This command reports
# all contents of the specified Mork file as a JSON string.
#
@piroor
piroor / file0.txt
Last active August 29, 2015 14:11
Droongaの分散処理を支える技術:通信プロトコル ref: http://qiita.com/piroor/items/2ca1e722c1bc48b17fce
{
"id": 01234,
"type": "select",
"date": "2014-12-16T00:00:00Z",
"from": "client0:10031/droonga",
"replyTo": "client0:10031/droonga",
"dataset": "Default",
"body": { "table": "Stores",
"output_columns": "name",
"limit": 10 }
@piroor
piroor / file0.txt
Last active August 29, 2015 14:11
Droongaの分散処理を支える技術:マスター無しでのクラスタ管理 ref: http://qiita.com/piroor/items/20caac6e66ea228585e9
{ "version": 3,
"datasets": {
"Default": {
"volume": { "replicas": [
{ "slices": [
{ "volume": { "replicas": [
{ "address": "node0:10031/droonga.000" },
{ "address": "node1:10031/droonga.000" }
] } },
{ "volume": { "replicas": [
@piroor
piroor / index.html
Last active September 9, 2015 10:47
Link to local file
<!DOCTYPE html>
<title>link to local file</title>
<a href="file:///c:/windows/">c:\windows\</a>
@piroor
piroor / computed-style.png
Created May 24, 2011 10:26
Screenshots around vertical tab bar
computed-style.png
@piroor
piroor / screenshot-fx6-tst-tabgroupsmanager
Created August 29, 2011 15:25
screen shot: Firefox 6 + Tree Style Tab + TabGroups Manager
With the prefs:
group bar = 0
tab bar = 1
@piroor
piroor / copy-all-visible-logs.js
Created November 9, 2015 10:14
Utility codes for Mozilla Thunderbird's error console (tested on Thunderbird 38)
Components.utils.import('resource://gre/modules/Services.jsm');var text=[];for (var row of Services.wm.getMostRecentWindow('global:console').document.getElementById('ConsoleBox').mConsoleRowBox.children) { if (row.boxObject.height > 0) { text.push(row.toString()); } }; Components.classes['@mozilla.org/widget/clipboardhelper;1'].getService(Components.interfaces.nsIClipboardHelper).copyString(text.join('\n---\n'));
@piroor
piroor / geturi.js
Last active December 15, 2015 03:19
Sample code to research the URI of the blocklist on the platform.
/**
* Original:
* http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/nsBlocklistService.js?raw=1
* Usage:
* 1. Go to "about:config" and turn "devtools.chrome.enabled" to "true".
* 2. Start "Scratchpad" with Shift-F4.
* 3. Change the context from "web page" to "browser".
* 4. Copy this script and paste to the scratchpad.
* 5. Run it.
* Sample result:
@piroor
piroor / one-time.js
Last active December 18, 2015 08:39
Stress test with one-time gradients
var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
canvas.width = 100;
canvas.height = 100;
canvas.setAttribute('style', 'width:100px;height:100px;position:fixed;top:0;right:0;z-index:10000;');
document.documentElement.appendChild(canvas);
var context = canvas.getContext('2d');
function random(max) {
return parseInt(Math.random() * max);
}