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 | |
# Screen size glitch for xvid encoded avi | |
require 'aviglitch' | |
avi = AviGlitch.open ARGV.shift | |
avi.glitch_with_index(:keyframe) do |data, i| | |
x = data[25..28].unpack('B*').first | |
w = rand(('0b' + x[0..12]).oct * 1.5) | |
h = rand(('0b' + x[14..26]).oct * 1.5) | |
x[0..12] = "%013b" % ((w > 50) ? w : 50) | |
x[14..26] = "%013b" % ((h > 50) ? h : 50) |
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/bash | |
if [ $# -lt 1 ] ; then | |
echo "usage: $0 ʅ(‾ρ◝)ʃ" | |
exit 0 | |
fi | |
for i in {1..20}; do | |
wget http://fuba.moaningnerds.org/unicodemoticon/?$1 -q -O $(printf "%02d" $i).png | |
done | |
convert -loop 0 -delay 10 *.png out.gif | |
#rm *.png |
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 Show panoid | |
// @namespace http://userscripts.org/users/ucnv | |
// @include http://maps.google.tld/maps* | |
// @include http://www.google.tld/maps* | |
// ==/UserScript== | |
document.getElementById('links') && (function() { | |
var ul = document.getElementById('links').getElementsByTagName('ul')[0]; | |
var li = [ul.childNodes[ul.childNodes.length - 2].cloneNode(true), document.createElement('li')]; |
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 Streetview Thumbnail | |
// @namespace http://userscripts.org/users/ucnv | |
// @include http://maps.google.tld/maps* | |
// @include http://www.google.tld/maps* | |
// ==/UserScript== | |
var zoom = 1; // 0-3 | |
function makeLink(panoid) { | |
var mx = [[1, 1], [2, 1], [4, 2], [6, 4]]; |
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 | |
# sample: http://gyazo.com/0e2f2ea0e7b7ef7100877acbf858587a.png | |
require 'open-uri' | |
require 'image_size' | |
def make_shade(times, process_shape, process_color) | |
times.times.inject('') do |result, i| | |
result + <<-DIV | |
<div class="shade" | |
style="height:#{process_shape.yield(i)}px;border-color:#{process_color.yield(i)};" |
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 | |
# Realtime push example using evma_httpserver's send_chunks | |
# It's taken from http://github.com/tobi/clarity | |
require 'eventmachine' | |
require 'evma_httpserver' | |
class Handler < EventMachine::Connection | |
include EventMachine::HttpServer | |
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
<html> | |
<head><title>Canvas Halftoning</title></head> | |
<body> | |
<canvas id="c"></canvas> | |
<img id="s" src="./pomeranian.jpg" /> | |
</body> | |
<script type="text/javascript"> | |
var interval = 8; | |
var angles = { y: 108, m: 162, c: 90, k: 45 }; |
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
# improved version of youpy's aa.rb | |
# http://svn.buycheapviagraonlinenow.com/repos/misc/aa.rb | |
require 'open-uri' | |
require 'nokogiri' | |
require 'fileutils' | |
urlbase = 'http://www.americanapparel.net/gallery/photocollections/models/' | |
Nokogiri.parse(open(urlbase).read).xpath('//a[@class="contentLink"]/@onclick').collect do |attr| | |
(attr.to_s =~ %r{'/gallery/photocollections/models/([^/]+/)'}) ? $1 : nil | |
end.uniq.compact.each do |model| |
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
<html> | |
<head><title>Canvas Delaunay Triangulation</title></head> | |
<body></body> | |
<script type="text/javascript"> | |
var img = new Image(); | |
img.onload = init; | |
img.src = './bg_10.jpg'; | |
var display, source; | |
var points = [], drew = []; |
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
s = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a | |
v = 5.times.map{|i| (i == 0 ? 6 : 12).times.map{ s[(rand * (i == 0 ? 62 : 26)).floor] }.join } | |
puts "#{v[0]} <a href=\"http://#{v[1]}.com/\">#{v[1]}</a>, [url=http://#{v[2]}.com/]#{v[2]}[/url], [link=http://#{v[3]}.com/]#{v[3]}[/link], http://#{v[4]}.com/" |