Skip to content

Instantly share code, notes, and snippets.

/* appjet:version 0.1 */
import("lib-json");
import("lib-list"); // Array.prototype.reduce
import("lib-jlp");
import("lib-text-converter");
convertText(function(text) {
var sentence = text || ' ';
var separator = "?./+*- ";
// ==UserScript==
// @name reddit redirect
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://www.reddit.com/*/comments/*
// @require http://gist.github.com/raw/3242/1a7950e033a207efcfc233ae8d9939b676bdbf46
// ==/UserScript==
(function() {
location.href = $X('//a[@class="title"]')[0].href;
})();
#!/usr/bin/env ruby
# a/b/c.mp3 -> a/b/a-b-c.mp3
require 'pathname'
require 'fileutils'
require 'enumerator'
include FileUtils::Verbose
src = Pathname.new(ARGV.shift)
dst = src.enum_for(:each_filename).inject([]) do |memo, filename|
require 'rubygems'
require 'nokogiri'
require 'open-uri'
def main
html = Nokogiri(open('http://www.last.fm/user/youpy/friends').read)
next_link = nil
tracks = []
begin
/* appjet:version 0.1 */
import("lib-json");
function get_main() {
page.setMode("plain");
// PST to JST
var date = new Date(new Date().getTime() + 17 * 3600 * 1000);
date.setSeconds(0);
date.setMinutes(0);
// ==UserScript==
// @name Teiten Uploader
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://teiten.org/everyone*
// ==/UserScript==
(function() {
GM_addStyle('.fav-add { display: none; }');
Number.prototype.times = function(f) {
require 'rubygems'
require 'rbosa'
OSA.utf8_strings = true
itunes = OSA.app('iTunes')
library = itunes.sources.find {|s| s.kind == OSA::ITunes::ESRC::LIBRARY }
tracks = {}
grep inf% -A 12 log.txt | grep .avi$ | cut -f 10 -d ' ' | xargs rm
require 'rubygems'
require 'octopi'
include Octopi
#Octopi::ANONYMOUS_API.trace_level = 'curl'
def preferred_language(account_name)
lang = Hash.new(0)
#!/usr/bin/env ruby
require 'webrick'
require 'webrick/httpproxy'
handler = Proc.new() do |req,res|
if (req.path == '/glm/mmap' and res['content-type'] =~ /binary/) ||
(req.host =~ /^cbk\d+\.google/ and res['content-type'] =~ /jpeg/)
res.body.gsub!(/0/m, rand(10).to_s)
res['cache-control'] = 'no-cache'