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
#!/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
// ==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
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
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' | |
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
path = File::expand_path ARGV.shift | |
scpt = <<SCPT | |
tell application "Finder" | |
activate | |
select POSIX file "#{path}" | |
end tell | |
tell application "System Events" | |
tell process "Finder" | |
keystroke "y" using {command down, option down} | |
end tell |
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 'echonest' | |
require 'aviglitch' | |
audio, *videos = ARGV | |
apikey = "YOUR-ECHONEST-API-KEY" | |
beat_threshold = 0.15 | |
fps = 30 | |
tmp = 'tmp.avi' | |
outfile = "out.mp4" |
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 | |
# Test script for yet another JPEG glitch technique. | |
# Rewrite YCbCr sampling factors in JPEG header. | |
# It's a version of http://gist.github.com/167060 | |
require 'erb' | |
data = File.open(ARGV.first) {|f| f.read } | |
data.force_encoding Encoding::BINARY | |
sof0 = data.index "\xFF\xC0" | |
ns = data[sof0 + 9].unpack('C').first |
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
# http://dl.dropbox.com/u/4316370/reversed_frames.mp4 | |
require 'aviglitch' | |
a = AviGlitch.open ARGV.shift | |
# datamosh | |
a.glitch(:keyframe) do |f| | |
nil | |
end | |
# reverse | |
q = a.frames[-1, 1] |