This file contains hidden or 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
/* 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 = "?./+*- "; |
This file contains hidden or 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 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; | |
})(); |
This file contains hidden or 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 | |
# 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| |
This file contains hidden or 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 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def main | |
html = Nokogiri(open('http://www.last.fm/user/youpy/friends').read) | |
next_link = nil | |
tracks = [] | |
begin |
This file contains hidden or 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
/* 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); |
This file contains hidden or 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 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) { |
This file contains hidden or 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 'rubygems' | |
require 'rbosa' | |
OSA.utf8_strings = true | |
itunes = OSA.app('iTunes') | |
library = itunes.sources.find {|s| s.kind == OSA::ITunes::ESRC::LIBRARY } | |
tracks = {} |
This file contains hidden or 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
grep inf% -A 12 log.txt | grep .avi$ | cut -f 10 -d ' ' | xargs rm |
This file contains hidden or 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 'rubygems' | |
require 'octopi' | |
include Octopi | |
#Octopi::ANONYMOUS_API.trace_level = 'curl' | |
def preferred_language(account_name) | |
lang = Hash.new(0) |
This file contains hidden or 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 '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' |