Skip to content

Instantly share code, notes, and snippets.

@knoajp
knoajp / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@knoajp
knoajp / javascript_resources.md
Last active Aug 29, 2015 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.
View javascript_resources.md

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@knoajp
knoajp / css_resources.md
Last active Aug 29, 2015 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.
View css_resources.md

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@knoajp
knoajp / fullscreen_ad_skipper.js
Created Jul 30, 2015
マイナビの記事前全面広告をスキップするGreasemonkeyを少々更新。ついでに日経トレンディネットにも対応。
View fullscreen_ad_skipper.js
// ==UserScript==
// @name Fullscreen Ad Skipper
// @namespace knoa.jp
// @description 憎たらしい全画面広告を自動でスキップします。
// @include http://news.mynavi.jp/*
// @include http://trendy.nikkeibp.co.jp/welcome/*
// ==/UserScript==
(function(){
switch(true){
View Nico_HeatMap.user.js
// ==UserScript==
// @name Nico HeatMap+
// @namespace https://github.com/segabito/
// @description コメントの盛り上がり状態をシンプルにグラフ表示。 GINZA用
// @include http://www.nicovideo.jp/watch/*
// @version 1.2.2
// @grant none
// ==/UserScript==
@knoajp
knoajp / niconico_beautifier.css
Last active Mar 27, 2016
ニコニコを美しく
View niconico_beautifier.css
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("^http:\/\/live\.nicovideo\.jp\/watch\/.*") {
/* 映像+コメントリストをもっと大きく */
html.JS_PLAYER_NORMAL{
overflow: hidden;
}
html.JS_PLAYER_NORMAL .user-ad-block,
html.JS_PLAYER_NORMAL #page_header,
html.JS_PLAYER_NORMAL #watch_title_box,
@knoajp
knoajp / TreeStyleTab_Beautifier.css
Last active Jun 17, 2016
ツリー型タブを美しくするStylish用CSS (一部Mac用かも)
View TreeStyleTab_Beautifier.css
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* 余計なUIを非表示に */
window[sizemode="fullscreen"] #navigator-toolbox,
window[sizemode="fullscreen"] #TabsToolbar,
window[chromehidden*="toolbar"] #nav-bar/*小ウィンドウ*/,
spacer.treestyletab-tabbar-toggler{
display:none !important;
}
View ShigiDB2_DownloadLinkCreator.user.js
// ==UserScript==
// @name ShogiDB2 DownloadLinkCreator
// @description 将棋DB2の検索結果一覧ページに棋譜ダウンロードボタンを追加します。
// @include https://shogidb2.com/latest*
// @include https://shogidb2.com/floodgate*
// @include https://shogidb2.com/tournament/*
// @include https://shogidb2.com/player/*
// @include https://shogidb2.com/strategy/*
// @require https://cdn.rawgit.com/polygonplanet/encoding.js/master/encoding.min.js
// @namespace knoa.jp
View CloseTabLater.js
/* タブを閉じる(CloseTabLater) */
(function(){
const DELAY = 5*1000;
const OPACITY = '0.5';
let current = gBrowser.mCurrentTab;
/* 最後のタブだったら素直に閉じる */
if(gBrowser.mTabContainer.childElementCount === 1) return gBrowser.removeTab(current);
/* 現在のタブに閉じる運命を与える */
let label = 'CloseTabLater-' + Date.now() + DELAY;
if(!('CloseTabLaters' in window)) window.CloseTabLaters = [];
View TournamentExpectator.js
(function(){
const COUNT = 1000000;
const FINAL = 1;
const SORT = false;
let tournament = [
[
[
[
{name: '村山慈明', rate: 1737},
{name: '三枚堂達也', rate: 1760},