Skip to content

Instantly share code, notes, and snippets.

@esehara
Created October 2, 2011 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esehara/1257556 to your computer and use it in GitHub Desktop.
Save esehara/1257556 to your computer and use it in GitHub Desktop.
死ぬまでの時間
// ==UserScript==
// @name 死ぬまでの時間
// @namespace youdeathtime
// @description 貴方が2038年1月19日3時14分7秒になるまでに何秒かかるか
// @include http*://*
// @require http://jquery.com/src/jquery-latest.js
// ==/UserScript==
(function(){
if(window != unsafeWindow.top){
return;
}
var notice_style = 'position:fixed;'
+'z-index:10000;'
+'right:0;'
+'bottom:0;'
+'background-color:red;'
+'color:white;'
+'padding:10px;'
+'margin:10px;'
+'color:black;';
var now = new Date();
var nowsecond = now.getTime();
// ---- 任意の数の場合は、ここをいじってください
//var deathyear = 2147483647;
//var deathtime = (deathyear - 1970) * 365 * 24 * 60 * 60 * 60 * 1000;
var deathtime = 2147483647000;
var nokori = deathtime - Math.floor(nowsecond / 1000);
$('<div style=\'' + notice_style + '\' id=\'death\'><p>死ぬまであと'+ nokori +'秒<p></div>').appendTo('body');
window.setInterval(function(){$('div#death').text('死ぬまであと' + nokori + '秒'); nokori = nokori - 1 },1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment