Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Takazudo / bgImgForRetina.css
Created March 10, 2011 14:11
how to handle high res display.
/* load http://www.modernizr.com/ then, do following for Retina display. */
.className {
background:url(test@1x.png); /* low res img */
}
@media only screen and (-webkit-min-device-pixel-ratio:2) {
.backgroundsize .className {
background:url(test@2x.png); /* high res img */
}
}
@edom18
edom18 / css3-property-duplicate
Created May 15, 2011 01:23
CSSのプロパティを、ベンダープレフィクス付きで複製するスクリプト。(インデントも引き継ぐよう修正)
function! CSS3PropertyDuplicate()
let reg_save = @@
silent normal Y
let css3 = @@
let ind = matchlist(css3, '\v(\s*)(.*)')
let webkit = ind[1] . "-webkit-" . ind[2]
let moz = ind[1] . "-moz-" . ind[2]
let ms = ind[1] . "-ms-" . ind[2]
let o = ind[1] . "-o-" . ind[2]
@Takazudo
Takazudo / randomPick.js
Created October 29, 2011 10:27
randomPick/randomNum
/* need underscore.js */
/**
* randomNum
* randomNum(3,6); => 4
*/
var randomNum = function(from, to) {
return from + Math.floor( Math.random() * (to - from + 1) );
};
@kyo-ago
kyo-ago / purpleplayer.js.patch
Created December 21, 2011 08:15
purpleplayer.js Android fill-mode, transform patch
// this patch is BSD License @kyo_ago
Index: purpleplayer.js
===================================================================
--- purpleplayer.js (revision 8175)
+++ purpleplayer.js (working copy)
@@ -239,6 +239,10 @@
);
}
+function isAndroid(){
@uupaa
uupaa / ios.xcode.md
Last active January 28, 2020 09:36
iOS device spec, versions and Xcode deployment target information

iOS Devices

Device CPU GPU Display OpenGL
iPod touch 4 A4 PowerVR SGX535 960 x 640 2.1
iPod touch 5 A5 PowerVR SGX543MP2 1136 x 640 2.1
iPad 1 A4 PowerVR SGX535 1024 x 768 2.1
iPad 2 A5 PowerVR SGX543MP2 1024 x 768 2.1
iPad 3 A5X PowerVR SGX543MP4 2048 x 1536 2.1
iPad 4 A6X PowerVR SGX554MP4 2048 x 1536 2.1
@momo-the-monster
momo-the-monster / threejsatlasloader.js
Last active May 5, 2022 14:51
Three.JS Atlas Loader
// json is a JSON atlas generated by TexturePacker
// imagepath is a url to the full texture atlas image
var atlasTexture = THREE.ImageUtils.loadTexture( imagepath, undefined, function() {
for (var key in json.frames) {
var tex = atlasTexture.clone();
var frame = json.frames[key].frame;
tex.repeat.x = ( frame.w / atlasTexture.image.width );