2012-03-01から1ヶ月間の記事一覧

earthquake

地震から一年 - Kato Kazuyoshi 大学の先生や科学的なバックグランドを持つ人達が楽観的ななかで、昔にインタビューを読んだ GRAPE の牧野先生が、今回の一連の事故について悲観的なことを書いていること、山形浩生が GQ や自分のページに書いていたこと、Da…

page++

page++ - Hatena::Let /* * @title page++ * @description page countup * @include http://* * @license MIT License */ var a=location.pathname.split('/'); var p=a[a.length-1]; if (/^\d+$/.test(p)) { p++; a.pop(); a.push(p); } else { a.push(2); …

AutoPagerize 症候群

(テスト) ? (式1) : (式2)とか if(テスト) (式1)より if(テスト) { (式1) } else { (式2) }とか if(テスト) { (式1) }の方がぱっと見、何なのかわかりやすい。無駄に縦に伸びても。 こういうわけで ↓ じつは ↓ なんとかみたいに、縦方向に処理してる? ひょっ…

cd..

cd .. - Hatena::Let /* * @title cd .. * @description up dir * @include http://* * @license MIT License */ a=location.pathname.split('/'); a.pop(); location.pathname=a.join('/'); https://developer.mozilla.org/ja/JavaScript/Reference/Global_…

習作

ex gkojaxlabo http://kagurazakaundergroundresistance.tumblr.com/ (最古の tumblr bot)のアーカイブから年月日を基準にランダムな post_id を生成する習作 https://gist.github.com/2197231 function getRandom() { var a = [ { 'year' : '2007' , 'min' …

ReblogMachine.endless_summer#choice

http://reblog.machine.mamemomonga.com/js/ReblogMachine.js から。 endless summer のために random な post_id を生成する部分。 choice: function () { for (var a = this.range.latest - this.range.oldest, b = [], c = 1; c <= 100; c++) b.push(Math…

http://blog.proto.jp/post/19497347319/ipad-retina-2048x1536-web-bookmarklet javascript: (function () { var m = document.createElement("meta"); m.name = "viewport"; m.content = "width=" (orientation ? 2048 : 1536)",initial-scale=0.5"; docum…

2004年、まだ JavaScript の威力を人が知るには至らず。Web のコッチ側とアッチ側はバラバラだった訳です。

2004-11-08 00:44:54

http://web.archive.org/web/20051018055846/http://ma.la/mirrorman/wiki.cgi/2004-11-08

trigger mouse click event via jQuery

http://stackoverflow.com/questions/773639/how-can-i-simulate-an-anchor-click-via-jquery <script type="text/javascript"> var a = $('.path > .to > .element > a')[0]; var e = document.createEvent('MouseEvents'); e.initEvent( 'click', true, true ); a.dispatchEvent(e); </script>

reblogMachieOpenDoor.user.js

reblog machine で "o" キーで tumblelog を、"r"キーで reblog ページを開くようにした。

reblog machine keybind

http://reblog.machine.mamemomonga.com/js/ReblogMachine.js $(window).keypress(function (b) { if (!b.ctrlKey && (b.which == 32 || 65 <= b.which && b.which <= 90 || 97 <= b.which && b.which <= 122)) { var b = String.fromCharCode(b.which), d; …

head.insertBefore(script, head.firstChild)

http://gihyo.jp/dev/serial/01/crossbrowser-javascript/0008 (function(){ var script = document.createElement('script'); var head = document.getElementsByTagName('head')[0]; script.src = 'xxx.js'; head.appendChild(script); })(); (function(){…