Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name nicovideo - fix restorePlayer for Opera10.
// @author miya2000
// @namespace http://d.hatena.ne.jp/miya2000/
// @include http://www.nicovideo.jp/watch/*
// @exclude http://*http*
// ==/UserScript==
javascript:(function F() {
if (window.restorePlayer) {
window.restorePlayer = function () {
<!DOCTYPE html>
<script>
window.onload = function () {
opera.io.webserver.addEventListener('download', download, false);
}
function download(e) {
var req = e.connection.request;
var res = e.connection.response;
if (req.queryItems && req.queryItems.url) {
var url = req.queryItems.url[0];
package jstest;
import org.mozilla.javascript.*;
import org.mozilla.javascript.tools.shell.*;
public class JsTest {
public static void main(String[] args) throws Exception {
try {
Context cx = Context.enter();
Global scope = new Global();
@miya2000
miya2000 / Cws2Fws.pm
Created May 5, 2009 03:41
Plagger Plugin: convert cws to fws.
package Plagger::Plugin::Filter::Cws2Fws;
require 5.6.0;
use strict;
use base qw( Plagger::Plugin );
use Compress::Zlib;
sub register {
my($self, $context) = @_;
(function(){
var d = document.implementation.createDocument('', '', null);
d.appendChild(d.createTextNode('\n'));
var opml = d.appendChild(d.createElement('opml'));
opml.appendChild(d.createTextNode('\n\t'));
var head = opml.appendChild(d.createElement('head'));
opml.appendChild(d.createTextNode('\n\t'));
var body = opml.appendChild(d.createElement('body'));
opml.appendChild(d.createTextNode('\n'));
alert(new XMLSerializer().serializeToString(d));
// ==UserScript==
// @name flash - remove kuso
// @author miya2000
// @namespace http://d.hatena.ne.jp/miya2000/
// @version 1.1.0
// @include http://*
// ==/UserScript==
(function() {
function main() {
var kuso = document.evaluate('//embed[contains(@src, "flash_detection.swf")]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
// ==UserScript==
// @name flash - disable script access
// @author miya2000
// @namespace http://d.hatena.ne.jp/miya2000/
// @version 1.0.1
// @include http://www.nttsolmare.com/*
// @exclude http://*http*
// ==/UserScript==
(function() {
package test01;
public class BinaryDumpTest {
public static void main(String[] args) {
System.out.print("Integer.MAX_VALUE : ");
binaryDump(Integer.MAX_VALUE);
System.out.print("Integer.MIN_VALUE : ");
binaryDump(Integer.MIN_VALUE);
System.out.print("-1 : ");
binaryDump(-1);
@miya2000
miya2000 / Java concurrent test. (synchronized, AtomicInteger)
Created September 27, 2008 19:30
Java concurrent test. (synchronized, AtomicInteger)
package test01;
import java.text.MessageFormat;
import java.util.concurrent.atomic.AtomicInteger;
public class ConcurrentTest {
static final int CONCURRENT = 100;
static final int LOOP = 100000;
static int counter;
static AtomicInteger aCounter;