Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Twittfilter for hitode909-RT
// @namespace http://d.hatena.ne.jp/send/
// @description twitter filter
// @include http://twitter.com/*
// @include http://mobile.twitter.com/*
// ==/UserScript==
//
(function (){
// ==UserScript==
// @name Twittfilter for hitode909-RT
// @namespace http://d.hatena.ne.jp/send/
// @description twitter filter
// @include http://twitter.com/*
// ==/UserScript==
//
(function (){
var filter = function(node) {
@cxx
cxx / pp-xml.rb
Created April 18, 2010 11:59
pretty print a xml
require 'rexml/document'
REXML::Document.new($stdin).write($stdout, 2)
// ==UserScript==
// @name lang ja
// @namespace http://twitter.com/cxx
// @include http://twitter.com/*
// @include http://www.tumblr.com/*
// @include http://favstar.fm/*
// ==/UserScript==
document.body.lang = 'ja';
#include <iostream>
#include <algorithm>
#include <boost/lexical_cast.hpp>
int main(int argc, char* argv[])
{
int post_id = boost::lexical_cast<int>(argv[1]);
std::string s;
char path_chars[] = "0123456789abcdefghijklmnopqrstuvwxyz";
@cxx
cxx / list_all_published_photos_on_tumblr.rb
Created May 9, 2009 18:23
privatize all published photos on Tumblr
#!/usr/bin/ruby
require 'open-uri'
require 'rexml/document'
user = ''
total = open("http://#{user}.tumblr.com/api/read?type=photo&num=0") do |f|
doc = REXML::Document.new(f)
REXML::XPath.first(doc, '//posts/@total').value.to_i
end