This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name mailto.js | |
// @namespace http://st98.github.io | |
// @description mailtoスキームのリンクをクリックした際、メーラーを起動するかどうか聞くようにするユーティリティ。 | |
// @include * | |
// ==/UserScript== | |
;(function () { | |
[].forEach.call(document.getElementsByTagName('a'), function (element) { | |
var address = element.getAttribute('href'); | |
address = address.match(/mailto:(.+)/); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.fromCharCode('高'.charCodeAt(0) + 1); // => '髙' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fujiwara = function (str) { | |
return str.split('').join('゛') + '゛'; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var slice = [].slice; | |
var Enum = function () { | |
var args = slice.call(arguments); | |
var count, len; | |
var result = {}; | |
for (count = 0, len = args.length; count < len; count += 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fizzbuzz-clojure) | |
(defn- fizz? [x] | |
(= 0 (mod x 3))) | |
(defn- buzz? [x] | |
(= 0 (mod x 5))) | |
(defn- fizzbuzz? [x] | |
(and (fizz? x) (buzz? x))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var partition = function (coll, n) { | |
var i = 0, j; | |
var len = Math.floor(coll.length / n); | |
var result = [], res; | |
for (; i < len; i++) { | |
res = []; | |
for (j = 0; j < n; j++) { | |
res.push(coll[i * n + j]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*´ω`*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var randint = function (min, max) { | |
if (max == null) { | |
max = min; | |
min = 0; | |
} | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HQ9Plus; | |
(function () { | |
HQ9Plus = function HQ9Plus(code) { | |
if (!(this instanceof HQ9Plus)) { | |
return new HQ9Plus(code); | |
} | |
this._code = code || ''; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Conway's Game of Life</title> | |
</head> | |
<body> | |
<script src="life.js"></script> | |
</body> |