Skip to content

Instantly share code, notes, and snippets.

@ino46
ino46 / gist:708890
Created November 21, 2010 16:44
sh で実行されたときに強制終了
#!bin/bash
last_cmd_arg="$_"
if [ "$last_cmd_arg" = '/bin/sh' ]; then
zenity --error --title='エラー' --text='sh で実行されています。'
#echo 'sh で実行されています。'
exit 1
fi
@ino46
ino46 / ラブひな一括ダウンロード.sh
Created November 27, 2010 01:00
ラブひな高画質版 一括ダウンロード
#!bin/zsh
seq 101 114 | sed -re 's/^1//g' | xargs -i wget -w 5 -t 1 -c -nc -O 'LH{}_hq.pdf' 'http://dl.j-comi.jp/download/book/1{}/hq'
@ino46
ino46 / gist:727452
Created December 3, 2010 19:47 — forked from ino46/gist:708890
sh で実行されたときに強制終了(ワンライン)
#ボツ
@ino46
ino46 / getStation4Radiko.js
Created January 17, 2011 21:38
Radiko で聴取可能な放送局を列挙(Firebug 向け)
// Firebug 向け
// http://radiko.jp/timetable/ で実行
for(var e in Iterator(document.querySelectorAll('#subNav > li > a')))
console.log(e[1].href.slice(-3) + ' - ' + e[1].textContent);
/* 結果例
TBS - TBSラジオ
QRR - 文化放送
LFR - ニッポン放送
@ino46
ino46 / ClearHighlight4GoogleCache.js
Created January 20, 2011 02:05
Clear Highlight for Google Cache
// title : Clear Highlight for Google Cache
// description :
// uuid : 2b5baf09-434f-4036-9e4f-022476094531
//bookmarklet
/*
javascript:(function(){if(window.location.hostname.indexOf("webcache.googleusercontent.com")===0){var a=window.location,b=encodeURI(decodeURI(a.href)),c=encodeURI(decodeURI(a.search)).split("&"),d=c[0].indexOf("+");if(d!==-1){var e=c[0].slice(0,d);b=b.replace(c[0],e);a.assign(b)}};})();
*/
// Firebug 向け
// http://gdata.youtube.com/feeds/base/users/hukuroo214/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile で実行
for(var e in Iterator(document.querySelectorAll('#feedContent > div.entry > h3 > a')))
console.log(e[1].href.replace('http://www.youtube.com/watch?v=', '').replace('&feature=youtube_gdata', '') + ' - ' + e[1].textContent);
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>NHK 番組検索</ShortName>
<InputEncoding>UTF-8</InputEncoding>
<Url type="text/html" method="GET" template="http://search.nhk.or.jp/hensei/query.html">
<Param name="area" value="001"/>
<Param name="date" value=""/>
<Param name="dateos" value="7"/>
<Param name="ch" value="21"/>
<Param name="ch" value="31"/>
@ino46
ino46 / gist:825214
Created February 13, 2011 22:16
属性を変更したorされたファイル&ディレクトリを列挙
#!bin/sh
#シンボリックリンクを除外したかったけれど無理だったorz スマートな方法は無いかな
#以下ボツネタ
#find ! -type l -print0 | xargs -0 lsattr | grep -Ev '^-----------------e-'
@ino46
ino46 / touchpad-on-off.sh
Created February 15, 2011 08:37
TouchPad Enable/Disable
#!/bin/sh
# TouchPad Enable/Disable
# tested on ASRock Multibook G22 + Ubuntu 10.04
myTouchPadDevice='SynPS/2 Synaptics TouchPad'
# How to get the device name
# $ xinput list
if xinput list "$myTouchPadDevice" >/dev/null 2>&1; then
@ino46
ino46 / nicovideolive4googlecalendar.js
Created March 19, 2011 17:27
ニコニコ生放送の予定をGoogleカレンダーに登録するブックマークレット http://d.hatena.ne.jp/ino46/20110320/1300555752
(function(){
try {
//定義
var d = document,titles,airdate,url,url_cal;
//URLの確認
url = location.toString();
if(
(url.indexOf('http://live.nicovideo.jp/watch/lv') != 0) &&
(url.indexOf('http://live.nicovideo.jp/gate/lv') != 0)