Skip to content

Instantly share code, notes, and snippets.

@7kry
7kry / gist:8747453
Last active August 29, 2015 13:55
http://p-valkyrie.jp/ のキャラクターを順番にマウスオーバするブックマークレット。スマートフォンとかだとどうにもならないから。
//javascript:
(function characters(i){ var id = function(i){ var arr = ["01", "02", "03", "04", "05", "06", "07", "mn", "09"]; return arr[i % arr.length] }; $("#type-" + id(i - 1)).mouseout(); $("#type-" + id(i)).mouseover(); setTimeout(function(){ characters(i + 1) }, 3000) })(0)
@7kry
7kry / gist:8767969
Last active August 29, 2015 13:55 — forked from rhenium/gist:8767927
class Sample
def hello
puts "hello"
end
def hello2
puts "hello2"
end
end
@7kry
7kry / open_tweets.js
Created February 7, 2014 15:03
Twitter公式のタイムラインのツイートを全部開く(ただしRT/Fav情報とかReplyテキストボックスとかは出ない)。
//javascript:
(function(){ $(".js-stream-item").each(function(){ $(this).addClass("js-has-navigable-stream").addClass("open").find(".js-hidden-from-collapse").removeClass("js-hidden-from-collapse") }) })()
@7kry
7kry / Enumerator_foo.rb
Created February 8, 2014 17:43
5.times.foo(:clear).foo(:push, "abc".chars).map(&:sample).join を書きたくて、こういうメソッドがあったらそれはとっても嬉しいなって、そう思うんだ。
class Enumerator
def foo(method, *args)
enum = Enumerator.new(self.size){|y|
self.each{|*yargs|
y.yield(*method.to_proc.call(yargs, *args))
}
}
if block_given?
enum.each{|*yargs| yield(*yargs) }
else
[ JPRS database provides information on network administration. Its use is ]
[ restricted to network administration purposes. For further information, ]
[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]
[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]
Domain Information: [ドメイン情報]
a. [ドメイン名] HOTMAIL.CO.JP
e. [そしきめい] ほっとめーるじゃぱん
f. [組織名] ホットメールジャパン
g. [Organization] Hotmail Japan
@7kry
7kry / usr-bin-vi
Created March 30, 2014 18:27
rootでvimを起動する時に、vi互換になってくれるおまじない。
#! /bin/sh
if [ $UID != 0 ]; then
exec /usr/bin/vim "$@"
else
exec /usr/bin/vim -u NONE "$@"
fi
#!/bin/bash
LANG=ja_JP.UTF-8
pid=$$
date=`date '+%Y-%m-%d-%H_%M'`
playerurl=http://radiko.jp/player/swf/player_3.0.0.01.swf
playerfile="/tmp/player.swf"
keyfile="/tmp/authkey.png"
@7kry
7kry / ideyo_photonouchi.js
Created April 9, 2014 14:56
Twitterでopenになっているtweetの画像を一斉にポップアップで開くやつ。
// javascript:
(function(){
$(".open div[data-card-type='photo'] .cards-base a").each(function(){
window.open($(this).attr("data-resolved-url-large"), "_blank", { });
});
})();
@7kry
7kry / twitter-profile.js
Last active August 29, 2015 13:58
クソみたいなTwitterユーザページを何とかしよう作戦。
// javascript:
$(".ProfileHeaderCard").parent().prepend($(".ProfileCanopy-avatar").removeClass("ProfileCanopy-avatar"));
$(".ProfileHeaderCard").css({"background-image": $(".ProfileCanopy-header").css("background-image"), "background-size": "cover"});
$(".ProfileCanopy-header").remove();
$(".ProfileCanopy").css({"height": "auto"});
$(".ProfileTweet-text").ready(function(){ $(this).removeClass("ProfileTweet-text").css({"white-space": "pre"}) });
$(".ProfileTweet-text").removeClass("ProfileTweet-text").css({"white-space": "pre"});
import random
def shuffle(s):
return "".join(map(lambda i: random.choice(s), s))
shuffle("クピドゥレビュー")