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
#!/usr/bin/env ruby | |
fail unless ARGV.length == 2 | |
file = ARGV[0] | |
weight = ARGV[1].to_i | |
open(file, "r+b:ASCII-8BIT") do |io| | |
ver, ntables, srange, eselector, rshift = io.read(12).unpack("Nn*") | |
fail unless Math.log2(ntables).floor == eselector and | |
(2**eselector)*16 == srange and |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'RMagick' | |
include Magick | |
palette = Hash[ *( | |
[ ["000000", "\u{2660}" ], ["157569", "\u{1f5fd}"], ["226699", "\u{1f17f}"], | |
["231f20", "\u{2b1b}" ], ["292f33", "\u{1f3b1}"], ["3b88c3", "\u{2139}" ], | |
["4288c1", "\u{1f53d}"], ["553986", "\u{1f47e}"], ["55acee", "\u{1f6b9}"], | |
["58595b", "\u{1f3a5}"], ["5c913b", "\u{264a}" ], ["5dadec", "\u{1f499}"], |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
fg = "\u{2b1c}" | |
bg = "\u{2139}" | |
opt = OptionParser.new | |
opt.on("-f CHAR") {|v| fg = v[0] } | |
opt.on("-b CHAR") {|v| bg = v[0] } | |
opt.parse!(ARGV) |
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 サムネイルから本棚に登録 | |
// @namespace http://twitter.com/cxx | |
// @include http://www.mangaz.com/* | |
// @include http://r18.mangaz.com/* | |
// @version 0.1.0 | |
// ==/UserScript== | |
"use strict"; |
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
#!/usr/bin/ruby | |
require 'open-uri' | |
require 'rexml/document' | |
user = '' | |
total = open("http://#{user}.tumblr.com/api/read?type=photo&num=0") do |f| | |
doc = REXML::Document.new(f) | |
REXML::XPath.first(doc, '//posts/@total').value.to_i | |
end |
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
#include <iostream> | |
#include <algorithm> | |
#include <boost/lexical_cast.hpp> | |
int main(int argc, char* argv[]) | |
{ | |
int post_id = boost::lexical_cast<int>(argv[1]); | |
std::string s; | |
char path_chars[] = "0123456789abcdefghijklmnopqrstuvwxyz"; |
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 lang ja | |
// @namespace http://twitter.com/cxx | |
// @include http://twitter.com/* | |
// @include http://www.tumblr.com/* | |
// @include http://favstar.fm/* | |
// ==/UserScript== | |
document.body.lang = 'ja'; |
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 Bing Images direct link | |
// @namespace http://twitter.com/cxx | |
// @include http://www.bing.com/images/* | |
// @version 0.0.1.20100403 | |
// ==/UserScript== | |
(function() { | |
function $(id) { |
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
require 'rexml/document' | |
REXML::Document.new($stdin).write($stdout, 2) |
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 Twittfilter for hitode909-RT | |
// @namespace http://d.hatena.ne.jp/send/ | |
// @description twitter filter | |
// @include http://twitter.com/* | |
// ==/UserScript== | |
// | |
(function (){ | |
var filter = function(node) { |
OlderNewer