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 | |
a.glitch :keyframe do |f| | |
nil | |
end | |
a.glitch :audioframe do |f| | |
f.gsub /\d/, "0" | |
end | |
a.output 'o.avi' |
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' | |
require 'fileutils' | |
base = "resource.avi" | |
insert = "text.avi" | |
audio = "bgm.mp3" | |
#-------------- | |
FileUtils.rm_r 'tmp' if File.exist? 'tmp' | |
FileUtils.mkdir 'tmp' |
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' | |
unit = 3 | |
step = 1 | |
cmd = "ffmpeg -i %s -an -vcodec copy -r 30 tmp.avi" % ARGV.shift | |
system cmd | |
g = AviGlitch.open "tmp.avi" | |
g.glitch :keyframe do |x| | |
nil |
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 Delicious Skull | |
// @namespace http://aspietribe.com/ | |
// @include http://www.delicious.com/* | |
// ==/UserScript== | |
document.getElementById('pagetitleContent').style.backgroundPosition = '0 -1900px'; |
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
#!/bin/sh | |
rm out/* | |
./webpconv -quality 100 -output_dir out img/* | |
cd out | |
for f in *.webp; do cat $f | sed 's/a/b/' > x-$f; done | |
../webpconv -format PNG x-* |
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 | |
# Based on https://gist.github.com/165171 | |
require 'ubygems' | |
require 'rmagick' | |
require 'webrick' | |
require 'webrick/httpproxy' | |
handler = Proc.new do |req, res| | |
if req.host =~ /^cbk\d+\.google/ and res['content-type'] =~ /jpeg/ |
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: | |
# |
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
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
// ==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]; |