This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date.dayInMonth = function(year, month) { | |
if (year instanceof Date) { | |
var date = year; | |
year = date.getFullYear(); | |
month = date.getMonth() + 1; | |
} | |
return new Date(year, month, 0).getDate(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var preloadImage = function(paths) { | |
if (!$.isArray(paths)) paths = $.makeArray(arguments); | |
for (var i = 0, path; path = paths[i]; i++) | |
new Image().src = path; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name random-color | |
// @namespace http://www.hatena.ne.jp/hitode909 | |
// @include * | |
// ==/UserScript== | |
var randomColor = function() { | |
return 'rgb(' + (Math.random() > 0.5 ? 255 : 0) + ', ' + (Math.random() > 0.5 ? 255 : 0) + ', ' + (Math.random() > 0.5 ? 255 : 0) + ')'; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- フルスクリーンにする --> | |
<meta name="apple-mobile-web-app-capable" content="yes"/> | |
<!-- ステータスバーを黒(半透明)にする --> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = document.querySelector.bind(document); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby | |
require 'rubygems' | |
require 'twitter' | |
require 'pit' | |
exit unless ARGV[0] | |
config = Pit.get('twitter', :require => { | |
'username' => 'username', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.i = function(n) { | |
var letter = this.charAt(this.length - 1); | |
var ret = [this]; | |
while (--n) ret.push(letter); | |
return ret.join(''); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in "$@" | |
do | |
python ~/apps/scour/scour.py -i "$f" -o "${f%.*}_.svgz" --enable-comment-stripping --enable-id-stripping --enable-viewboxing --indent=none --strip-xml-prolog --remove-metadata --shorten-ids --strip-xml-prolog | |
mv -f "${f%.*}_.svgz" "$f" | |
echo "$f" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var supported_inline_svg = function() { | |
var div = document.createElement('div'); | |
div.innerHTML = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>'; | |
return (div.childNodes[0].namespaceURI == 'http://www.w3.org/2000/svg'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Endless Summer on dsbd | |
// @namespace http://www.tumblr.com/ | |
// @description random next link on tumblr dashboard | |
// @include http://www.tumblr.com/dashboard/1* | |
// @include http://www.tumblr.com/show/*/1* | |
// @require http://gist.github.com/3242.txt | |
// @require http://gist.github.com/198443.txt | |
// @require http://gist.github.com/34615.txt | |
// @version 0.0.4.0.2 |