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 | |
# make a human readable word-number-word style password. | |
# following wordlist is taken from http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt | |
l = %w( | |
acrobat africa alaska albert albino album | |
alcohol alex alpha amadeus amanda amazon | |
america analog animal antenna antonio apollo | |
april aroma artist aspirin athlete atlas | |
banana bandit banjo bikini bingo bonus | |
camera canada carbon casino catalog cinema |
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 | |
# Redirect to the url in the server's clipboard | |
if defined? Rack then | |
Redirector = Rack::Builder.new { | |
use Rack::ContentLength | |
app = Proc.new { |env| | |
u = IO.popen('pbpaste', 'r+').read | |
[303, {'Location' => u, 'Content-Type' => 'text/plain'}, ['']] | |
} | |
run app |
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 'ubygems' | |
require 'grope' | |
require 'RMagick' | |
class Grope::WSOWrapper | |
def undefined? | |
@wso.class.to_s == 'OSX::WebUndefined' | |
end | |
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
var tweet; | |
var twitter_id = ""; | |
var twitter_pw = ""; | |
var phase; | |
var setState = function(nextPhase) { | |
var s = {tweet: tweet, twitter_id: twitter_id, twitter_pw: twitter_pw, phase: nextPhase}; | |
phantom.state = JSON.stringify(s); | |
}; | |
if(!phantom.state.length) { | |
var i, args = Array.prototype.slice.apply(phantom.args); |
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 'aviglitch' | |
unless ARGV.size >= 2 | |
puts "Usage: ruby #{$0} INFILE PATTERN [FPS]" | |
puts " ruby #{$0} file.mp3 0010001000010011" | |
exit | |
end | |
infile, pattern, fps = ARGV | |
fps = 60 unless fps | |
cmd = "ffmpeg -i %s -sameq -r %d -vn tmp1.avi" % [infile, fps] |
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 'aviglitch' | |
unless ARGV.size >= 2 | |
puts "Usage: ruby #{$0} INFILE PATTERN [FPS]" | |
puts " ruby #{$0} file.mp3 0010001000010011" | |
exit | |
end | |
infile, pattern, fps = ARGV | |
fps = 60 unless fps | |
cmd = "ffmpeg -i %s -sameq -r %d -vn tmp1.avi" % [infile, fps] |
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 Tokyo Kafun on Twitter | |
// @namespace http://userscripts.org/users/40991 | |
// @include http://twitter.com/* | |
// ==/UserScript== | |
function i(d) { | |
var n = d ? new Date(d) : new Date(); | |
var y = n.getFullYear().toString(); | |
var m = ('0' + (n.getMonth()+1)).match(/\d{2}$/)[0]; |
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 'aviglitch' | |
a = AviGlitch.open ARGV.shift | |
keys = [] | |
a.frames.each_with_index do |f, i| | |
keys << i if f.is_keyframe? | |
end | |
keys.each do |i| | |
fa = a.frames[i] | |
fb = a.frames[i+1] |
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 './jpg_encoder' # https://gist.github.com/708485 | |
class XJPG < JPGEncoder | |
def process_DU *args | |
@zigzag_o = @zigzag_o || @zigzag | |
@zigzag = @zigzag_o.shuffle | |
super *args | |
end | |
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
# This file is a kind of Ruby port of JPGEncoder.as | |
# <https://github.com/mikechambers/as3corelib/blob/master/src/com/adobe/images/JPGEncoder.as> | |
# Copyright (c) 2008, Adobe Systems Incorporated | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are | |
# met: | |
# |