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 Hatena::Diary - Replace mimeTeX by ASCIIMathML | |
// @namespace http://subtech.g.hatena.ne.jp/motemen/ | |
// @include http://d.hatena.ne.jp/* | |
// @include http://*.g.hatena.ne.jp/* | |
// @include https://*.g.hatena.ne.jp/* | |
// ==/UserScript== | |
// Thanks to ASCIIMathML http://www1.chapman.edu/~jipsen/asciimath.html | |
var texImages = document.evaluate('//img[@class="tex"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); |
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 id:USERNAME | |
// @namespace http://subtech.g.hatena.ne.jp/motemen/ | |
// @include http://*.hatena.ne.jp/USERNAME/ | |
// @include http://*.hatena.ne.jp/USERNAME | |
// ==/UserScript== | |
location.href = location.href.replace('USERNAME', 'motemen'); |
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
100000th post |
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
#!perl | |
use strict; | |
use warnings; | |
use File::Temp; | |
my $basename = shift; | |
my $output = `cat $basename.in | perl $basename.pl`; | |
my $fh = File::Temp->new; | |
print $fh $output; | |
exec "diff -u $basename.out " . $fh->filename; |
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 s/Bishoujo/Ijoufu/g | |
// @namespace http://subtech.g.hatena.ne.jp/motemen/ | |
// ==/UserScript== | |
function ijoufize (node) { | |
var children = node.childNodes; | |
for (var i = 0; i < children.length; i++) { | |
if (children[i].nodeType == children[i].TEXT_NODE) { | |
children[i].nodeValue = children[i].nodeValue.replace(/美少女/g, '偉丈夫'); |
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
addBefore(Tumblr, 'post', function (ps) { | |
if (ps.itemUrl.match(/^http:\/\/img\d+\.pixiv\.net\/img\/([^\/]+?)\/\d+_m\.\w+$/)) { | |
ps.itemUrl = ps.itemUrl.replace(/_m(\.\w+)$/, '$1'); | |
} | |
if (ps.pageUrl.match(/^http:\/\/www\.pixiv\.net\/member_illust\.php\?mode=big&illust_id=\d+$/)) { | |
ps.pageUrl = ps.pageUrl.replace(/mode=big/, 'mode=medium'); | |
} | |
}); |
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
object HelloWorld { | |
def quickSort(list : List[Double]) : List[Double] = | |
list match { | |
case Nil => Nil | |
case List(x) => list | |
case x :: xs => quickSort(xs filter (x >=)) ::: List(x) ::: quickSort(xs filter (x <)) | |
} | |
println(quickSort(List(3,1,4,1,5,9,2))) | |
println("Hello, world!") |
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
import scala.io.Source | |
import scala.collection.immutable._ | |
abstract class Bencoding | |
case class BString(string : String) extends Bencoding | |
case class BInt(number : Int) extends Bencoding | |
case class BList(list : List[Bencoding]) extends Bencoding | |
case class BDict(dict : Map[String,Bencoding]) extends Bencoding | |
object Bencoding { |
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
package net.tokyoenvious.scalatest | |
import org.scalatest._ | |
class TAPReporter extends Reporter { | |
var testNumber : Int = 1 | |
override def runStarting (testCount : Int) = | |
println ("1.." + testCount) |
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
object Main extends Application { | |
object TAP { | |
var number:Int = 1 | |
var directive = "" | |
def plan (planNum:Int) { | |
println( | |
"1.." + planNum | |
) |