Skip to content

Instantly share code, notes, and snippets.

View 0mg's full-sized avatar
💤

Ray Milligram 0mg

💤
View GitHub Profile
@0mg
0mg / bgvw.js
Created January 12, 2010 14:04
js: 背景画像表示
javascript:(function(b){b=/\(\x22?([^\x22|\)]+)/.
exec(getComputedStyle(document.body,'').backgroundImage);
b=b?b[1]:document.body.background;b&&open(b,'_blank');})();
@0mg
0mg / mosaic char.js
Created January 13, 2010 05:41
js: モザイク
javascript:(function(c,z,Z,m,s){
c = function(e,r,c){
r = function(){ return (Math.random()*256^0) };
c = function(c){ return ( "rgb(" + (c = r()) + "," + c + "," + c + ")") };
e.style.backgroundColor = e.style.color = c();
};
z = function(E,e,i,t,j,S,s){
for( e = E.childNodes, i = 0; i < e.length; i++){
if(
( e[i].nodeType == 3 || e[i].nodeType == 4 )
@0mg
0mg / favstar.user.js
Created February 3, 2010 07:42
Favstar the Favotter Style
// ==UserScript==
// @name favstar the favotter style
// @include http://favstar.fm/*
// ==/UserScript==
(function() {
var tweetContainers =
document.evaluate('.//div[@class="tweetContainer"]', document, null, 5, null);
var tweetContainer;
while (tweetContainer = tweetContainers.iterateNext()) {
@0mg
0mg / gist:294288
Created February 4, 2010 01:56
Twitter Unassigned
// Unassigned Screen Names on Twitter
["12", "16", "1k", "1m", "21", "2a", "2i", "2q", "43", "4g", "4l", "4v", "5p", "5v", "65", "6d", "6m", "6u", "6w", "77", "7c", "7f", "7l", "7m", "7s", "7u", "8f", "8h", "8q", "91", "97", "9e", "9f", "9k", "9l", "9q", "9u", "9w", "9y", "0q", "0t", "0u", "ca", "cl", "cu", "dq", "e0", "el", "fl", "ga", "gi", "gu", "il", "im", "iu", "lf", "ms", "nd", "nj", "nl", "no", "np", "nv", "or", "pa", "pw", "q8", "qa", "r1", "r2", "r0", "rg", "ri", "s3", "sm", "t6", "u2", "u6", "ua", "um", "ut", "va", "vt", "wc", "wi", "wt", "wv", "wy", "xl", "yp", "z3", "zp"]
@0mg
0mg / gist:302383
Created February 12, 2010 06:56
ナベアツ
javascript:for(i=0;confirm(++i%3>/3/(i)?i:i+"(・∀゚)"););
javascript:for(i=0;confirm(++i%3&&!/3/(i)?i:i+"(・∀゚)"););
javascript:for(i=0;confirm(++i+(i%3&&!/3/(i)?0:"(・∀゚)")););
javascript:for(i=0;confirm(++i+(i%3<1||/3/(i)?"(・∀゚)":0)););
@0mg
0mg / gist:304386
Created February 15, 2010 02:39
ランダムひらがな 140 字出力ブックマークレット
javascript:for(s="";!s[139];)
s+=String.fromCharCode(12353+Math.random()*82);
alert(s)
@0mg
0mg / jstip.md
Created February 17, 2010 05:31
JS Tips

正規表現

マッチの性質

"123abc".match(/abc|3ab/) /* 3ab */

文字列の先頭から検索が始まり、マッチすると途中で検索が終わる。

[123]abc  abc? NO. 3ab? NO.

1[23a]bc abc? NO. 3ab? NO.

@0mg
0mg / gihyo.css
Created February 18, 2010 00:16
gihyo.css
@import "user.css";
[id *= "headerBanner"],
#secondary,
#sub,
#footer {
display: none !important;
}
#wrapper,
#primary,
@0mg
0mg / gist:322616
Created March 5, 2010 10:09
円周率計算ブックマークレット
// Spigot Algorithm
// http://www14.ocn.ne.jp/~kk62526/pi/Spigot.html
javascript:
for(a=[],c=52514,f=1e4,d=h=0;b=c-=14;
document.write("<li>",("000"+(e+d/f|0)).slice(h=-4)))
for(e=d%=f;g=--b*2;d=d/g|0)d=d*b+f*(h?a[b]:f/5),a[b]=d%--g
@0mg
0mg / twitter-border-radius.css
Created March 12, 2010 14:24
Twitter border-radius for Opera 10
.round {
border-radius: 5px !important;
}
.round-left {
border-radius: 5px 0 0 5px !important;
}
.round-right {
border-radius: 0 5px 5px 0 !important;
}