Skip to content

Instantly share code, notes, and snippets.

View syoichi's full-sized avatar

Syoichi Tsuyuhara syoichi

View GitHub Profile
@azu
azu / [email protected]
Last active August 29, 2015 14:03
LDRをj、kで前後の記事、nで新しいタブで開くGreasemonkey - http://la.ma.la/blog/diary_200604261407.htm
// ==UserScript==
// @name ldr_keyhack_jkc+n
// @namespace http://ma.la/
// @include http://reader.livedoor.com/reader/*
// @version 1.0
// @grant GM_openInTab
// ==/UserScript==
function main() {
function openNewBackgroundTab(url) {
@Ede123
Ede123 / userChrome.css
Last active February 11, 2020 11:06
CSS code to get Firefox' Australis theme usable (features: tabs on bottom; rectangular tabs; small space saving back/forward button; tweaked colors in tabbar)
/* FIXES TO AUSTRALIS THEME */
/* bookmarks toolbar below adress bar */
#PersonalToolbar {
-moz-box-ordinal-group: 2 !important;
}
/* tabs bar below adress bar and bookmarks toolbar */
#TabsToolbar {
-moz-box-ordinal-group: 3 !important;
margin: 0 !important;
padding: 0 !important;
@tj
tj / stuff.md
Last active September 30, 2017 19:13
ES6 modules

Ok so http://wiki.ecmascript.org/doku.php?id=harmony:modules looks more less the same as it did last time I looked, however that document combined with https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-06/jun-5-modules.md#do-we-need-the-module-foo-from-foo-import-syntax looks like we're conflating quite a few concepts (IMO... not trying to anger anyone).

Personally I'm in favour for removing module as mentioned in the gist. I would also remove re-exporting (export * from "crypto"), even if it's a nicety I can't say out I've done much re-exporting in the thousands and thousands of modules I've written, does anyone else do this often? (not sure)

Single exported value

Personally (barring weird edge-cases I'm not aware of?) I would love if we only had exporting a single or multiple value, with only one syntax for importing. For example the common use-case of exporting a single function or value:

ferret.js

@rwaldron
rwaldron / tdz-1.js
Last active April 4, 2018 21:20
Temporal Dead Zone
{
// The block has begun, we're in a new block scope. The TDZ for the "a" binding has begun
var f = function() {
// 2. Because f() is evaluated before `a` is actually declared,
// an exception will be thrown indicating to the author that
// `a` is not yet defined.
console.log(a);
};
@YungSang
YungSang / patch.extractor.youtube.extract.tbrl.js
Last active August 29, 2015 14:02
[Deprecated] Taberareloo 用パッチ:YouTube からのポストを復活+関連動画からポストしても正常に動作するように修正
// ==Taberareloo==
// {
// "name" : "Fix extractor for YouTube"
// , "description" : "Fix extractor for YouTube"
// , "include" : ["background", "content"]
// , "match" : ["*://*.youtube.com/watch*"]
// , "version" : "0.1.3"
// , "downloadURL" : "https://gist.github.com/YungSang/7acd58f084f1748d0e28/raw/patch.extractor.youtube.extract.tbrl.js"
// }
// ==/Taberareloo==
@mala
mala / gist:61a2eef2833bfef0456b
Created June 12, 2014 12:49
RFC7231のリファラに関するメモ
https://twitter.com/bulkneets/status/476343189717012480
をきっかけにリファラにabout:blankが提案された経緯について調べていた。
単にnull値として使えると定義されただけで、現状積極的に送れと推奨されているわけではないと認識している。
この変更で https://trac.tools.ietf.org/wg/httpbis/trac/changeset/2072
「about:blank送る or 全く送らない」と書かれていたのが「全く送らない or about:blank送る」と順番逆になったりしている。
----
RFC7231のリファラに関するメモ
@kuu
kuu / promises.md
Last active April 20, 2016 07:31 — forked from domenic/promises.md

This is a Japanese translation from the original Gist in English. 原文:You're Missing the Point of Promises by Domenic Denicola

====== この記事は私のブログでも掲載しています。また、記事中で Promises/A に言及している箇所がありますが、この記事が書かれた当時は Promises/A+の仕様がまだ存在しなかったので、少し古く感じられるかもしれません。

あなたの知らない JavaScript Promise

// applicationCacheの更新を妨害する
Object.defineProperty(this,'applicationCache',{get:function(){return{}}});
(function () {
// AppCache上でlocation.hrefを読み込むとAppCacheの内容を読み込むため、「ブラウザは別URLと認識するが、サーバは同じコンテンツを返すURL」を作る
contentLoad(location.href+'/');
// 本来であればsubmit等のイベントもキャッチする必要がある
window.addEventListener('click', function (evn) {
var elem = evn.target;
while (elem.tagName.toLocaleLowerCase() != 'a') elem = elem.parentNode;
@YungSang
YungSang / patch.userscript.fix.tumblr.pin.tbrl.js
Last active August 29, 2015 14:02
Taberareloo 用パッチ:Pin したポストが画面から隠れてもコンテンツをそのままにする為のパッチ (Alpha)
// ==Taberareloo==
// {
// "name" : "Fix Tumblr Dashboard pin action"
// , "description" : "Fix Tumblr Dashboard pin action"
// , "include" : ["content"]
// , "match" : [
// "*://www.tumblr.com/dashboard*"
// ]
// , "version" : "0.1.1"
// , "downloadURL" : "https://gist.github.com/YungSang/b9682d3f24622d4e251a/raw/patch.userscript.fix.tumblr.pin.tbrl.js"
@teppeis
teppeis / InferConsts.md
Last active August 29, 2015 14:02
What's InferConsts of Closure Compiler

InferConstsとは

このコミットで、実質的な定数をうまく推論できるようになった。(現在のmasterではデフォルト有効になっている)

以下のいずれかの条件を満たしたとき、その変数を定数とみなす。

  1. "well-defined"かつ一度しか代入されていない
  2. @const アノテーションが付いている
  3. const キーワードで宣言されている
  4. 命名規約によって定数であることがわかる