Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Dashboard Drag Scroll
// @namespace http://d.hatena.ne.jp/arikui/
// @include http://www.tumblr.com/dashboard
// @include http://www.tumblr.com/tumblelog/*
// @grunt none
// ==/UserScript==
var position = {
mutable: false,
@arikui
arikui / upload.php
Last active December 12, 2015 09:09
<?php
header("content-type: text/plain");
$images_dir_name = "images";
$ip = $_SERVER["REMOTE_ADDR"];
// machine dirs
$script_filedir = dirname($_SERVER["SCRIPT_FILENAME"]);
$image_save_dir = $images_dir_name . DIRECTORY_SEPARATOR . $ip;
define("SAVE_DIR", $script_filedir . DIRECTORY_SEPARATOR . $image_save_dir);
$(".twitter-anywhere-tweet-box-editor").attr("value","トラウマチキン".split("").map(function(v){return{v:v,toString:function(){return Math.random();}}}).sort().map(function(v){return v.v}).join(""));
<!doctype html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">
<title>aa</title>
<script type="text/javascript">
var tests = {
case0: testCase("plain", function(i){
var o = {
r: 1,
f: function(n){
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
var img = document.querySelector("img");
canvas.width = img.naturalWidth;
canvas.height = img.naturalHeight;
context.drawImage(img);
document.body.textContent = canvas.toDataURL();
(function(){
var s = document.createElement("script");
s.src = "http://github.com/arikui/image_processing.js/raw/master/image_processing.js";
var onload = s.onload = function(){
console.time("s");
var ip = new ImageProcessing(jspainter.canvas);
console.timeEnd("s");
// ==UserScript==
// @name mobile to pc
// @namespace d.hatena.ne.jp/arikui
// @include http://twitter.com/*
// ==/UserScript==
for each(var a in document.querySelectorAll('.entry-content a')) (function(a){
if(!a.href.match("http://mobile.twitter.com/statuses/")) return;
GM_xmlhttpRequest({
// ==UserScript==
// @name misakurago
// @namespace d.hatena.ne.jp/arikui
// @include http://twitter.com/
// @description http://jet-black-laver.sakura.ne.jp/RTM/nankotu.htm
// ==/UserScript==
GM_xmlhttpRequest({
method : "GET",
url: "http://jet-black-laver.sakura.ne.jp/RTM/misakura.js",
(function(lv, ps, init){
ps.each(function(i, v){ return Math.random() > 0.3 ? v.src = lv : v.src; });
var timer = setInterval(function(bs){
ps.map(function(i, img){
var x = i % 6, y = i / 6 << 1 >> 1, n = 0, cs = $.each(
[[x - 1, y - 1], [x, y - 1], [x + 1, y - 1],
[x - 1, y ], [x + 1, y ],
[x - 1, y + 1], [x, y + 1], [x + 1, y + 1]],
function(i, v){
if(v[0] < 0 || v[0] >= 6 || v[1] < 0 || v[1] >= 6) return;
@arikui
arikui / gist:69913
Created February 25, 2009 00:39
Command Interpreter Protocol
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
var Ci = Components.interfaces;
var Cc = Components.classes;
var Command = {
evaluators: {
"-e": function(cmd, code, args){
return new Command.Evaluator(cmd.length ? eval(cmd) : "",
code.length? eval(code) : "",