Skip to content

Instantly share code, notes, and snippets.

Avatar

Kazuya Takeshima mitukiii

View GitHub Profile
View replace_full_images.user.js
// ==UserScript==
// @name Replace Full Images
// @namespace jp.mitukiii.twitpic
// @include http*://twitpic.com/photos/*
// ==/UserScript==
(function() {
Array.prototype.each = function(iterator) {
for (var i = 0; i < this.length; i += 1) {
iterator(this[i], i);
};
@mitukiii
mitukiii / a_smart_dashboard_have_my_id.user.js
Created Jul 24, 2010
TumblrのDashboardで自分からReblogされた/自分のidを含んだpostを折り畳むスクリプト("A smart dashboard is_mine"に依存)
View a_smart_dashboard_have_my_id.user.js
// ==UserScript==
// @name A smart dashboard have my id
// @namespace http://mitukiii.jp/
// @description TumblrのDashboardで自分からReblogされた/自分のidを含んだpostを折り畳むスクリプト
// @include http://www.tumblr.com/*
// @include https://www.tumblr.com/*
// ==/UserScript==
(function() {
var my_id = document.querySelector('#user_channels a')
View Tumblr2epub.rb
$KCODE = 'u'
require 'rubygems'
require 'open-uri'
require 'xmlsimple'
require 'eeepub'
class String
def strip_tags
View FlashRenderer.class.php
<?php
class FlashRenderer
{
protected
$url,
$flash,
$replaces;
public static function make($url, $replaces = array())
View sfFlashRenderer.class.php
<?php
class sfFlashRenderer extends FlashRenderer
{
public function render($context = null)
{
if (count($this->replaces) > 0) {
$this->flash = self::rewrite($this->flash, $this->replaces);
}
if (is_null($context)) {
View FlashRenderer.sample.php
<?php
require_once("FlashRenderer.class.php");
// swfのファイルパスを引数にインスタンスを生成
// setメソッドで埋め込みたい変数名、内容を渡す
// renderメソッドでswfを書き換え、出力する
$flash = new FlashRenderer('flash.swf');
$flash->set('name' , 'mitukiii');
$flash->set('title', 'Say Hello to Sunshine');
View Tumblr2epubSample.rb
load 'Tumblr2epub.rb'
tumblr = Tumblr2epub.read('mitukiii', 2000, nil, true)
page = 200
tumblelog = tumblr[:tumblelog]
title = tumblelog['title']
posts = tumblr[:posts].reverse
(posts.length / page).times do |i|
_tumblr = {}
_tumblr[:tumblelog] = tumblelog
View createTweetHTML.js
javascript:prompt('', '<div class="twitter_timeline"><a href="' + location.href + '" target="_blank"><img class="left" src="' + document.querySelector('.profile-pic img').src.replace(/myphoto_bigger/, 'myphoto_normal') + '" alt="" /></a> <p class="left">' + document.querySelector('.screen-name').textContent + ': ' + document.querySelector('.entry-content').innerHTML + '</p> <br class="twitter_timeline_bottom" /></div>');void(0);
View それと便所カバー.js
javascript:
(function() {
if (!location.href.match('^https?:\/\/twitter\.com/')) {
return;
}
var それと便所カバー = function(ポスト) {
ツイート = ポスト.getElementsByClassName('entry-content')[0];
View hide_recommended_user.user.js