Skip to content

Instantly share code, notes, and snippets.

@Constellation
Constellation / tumblr_old_favicon.css
Created January 18, 2009 07:43
replace new tumblr icon to old one
.tabbrowser-tab[image^='http://assets.tumblr.com/images/'] .tab-icon-image,
#page-proxy-favicon[src^="assets.tumblr.com/images/"],
tab[image^="http://assets.tumblr.com/images/"] .tab-icon,
tab[image^="http://assets.tumblr.com/images/"] .tab-icon
{
width: 16 !important;
padding-left: 16px !important;
background: transparent url("http://assets.tumblr.com/images/favicon.gif?0") center center no-repeat !important;
/* background: transparent url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAACvElEQVQ4jZ2TW28bZRCGV61jx3vyem3HdezNeu21t87Gpzo2dgItbUwaUvcLfIVPoop6AEqEuAOaC7jBSEUCfgYV8Es43uQiPyT%2F4OEikdtKcMNIczfv885oZrTR9g6jrZtsTm4yGN%2Fg2ug6vc1tOoMJ7f6YuDuk1R4QxT2aVzuE0QZBYx2%2FFuFVG2jDrVsIqf5XltcCtM3Jmwip6I%2Bu0xtu0xlsXTiPWG8PiOI%2BjVaHehQThOv4tSaeHyKkolT20a6NbyCkojfcpjuY8PjjT%2Fnq6284fPgRhw8%2B5P7hIz44fMiTo8%2F4%2FItjyms1VisBQiqKVypo%2FdEbCKkWzn%2F%2B9Tf%2FFWdnZwT1JitXygipKKyU0HrD1xFSsdEfs%2Fu2AODnX35lteIthG%2Ft3ubp8TEAnxwdkXULzA7ukcsX0TqDLYRUxN0hDx4%2F4bff%2F8DzAzLZ3AKwM51imDY%2FPX%
@Constellation
Constellation / check_followers.rb
Created January 21, 2009 12:52
check tumblr followers and followings. work with mechanize 0.9.0
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'cgi'
email = ''
password = ''
email, password = ARGV
@Constellation
Constellation / test2.js
Created January 23, 2009 09:24
<script>alert("A")</script>
alert("test2");
#include <stdio.h>
#include <stdlib.h>
// http://d.hatena.ne.jp/javascripter/20090218/1234966398
// こんなかんじなのかな?
typedef struct list {
char c;
struct list* next;
struct list* prev;
} LIST;
// http://d.hatena.ne.jp/Yoshiori/20090218/1234945857
var a = [];
http://d.hatena.ne.jp/Constellation/
for(var i = 0, l = 200; i < l; ++i){
if(i == 100) break http;
a.push(i);
}
alert(a);
// ==UserScript==
// @name test head method
// @namespace test for head method on GM_xmlhttpRequest
// @include *
// ==/UserScript==
(function(){
var opt = {
//なんとなくGoogle Chromeのvideoっぽいもの.
url: 'http://www.youtube.com/get_video?&fmt=22&video_id=k8wz7S8IDq8&t=vjVQa1PpcFOM9OObEAE4H50xwsy01REszoRFXWWk1LE=',
onload: function(res){
require 'webrick'
# method確認用
path = File.expand_path('~/dev/html')
srv = WEBrick::HTTPServer.new({
:DocumentRoot => path,
:BindAddress => '0.0.0.0',
:Port => 10080,
:AccessLog => [[STDERR, "%m %r %s"]],
})
['INT', 'TERM'].each do |signal|
// ==UserScript==
// @name twitter.AutoPager
// @namespace http://ss-o.net/
// @version 0.1
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==
(function autopager(unsafeWindow,loaded){
if (!loaded && window.opera && document.readyState == 'interactive') {
require 'open-uri'
require 'kconv'
require 'json'
$KCODE = 'u'
def parse text
reg = /^ ([^:]+): *'?((?:'|[^'])*?)'? *,? *$/
info = {}
updated = false
text.split(/(?:\r\n|[\r\n]+)/).inject([]){|memo, line|
@Constellation
Constellation / reindexer.rb
Created May 12, 2009 14:01
Firefox SQLite vacuum + reindex on Linux
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# usage:
# $ ruby #{this_file} #{firefox_profile_directory}
# or
# if pwd is firefox profile directory
# $ ruby #{this_file}
#
if ARGV.empty?