Skip to content

Instantly share code, notes, and snippets.

View is8r's full-sized avatar
🙂

Yu Ishihara is8r

🙂
View GitHub Profile
SocialPost.twitter("呟きたい文字列");
XxxController xxx = FindObjectOfType<XxxController> ();
.xxx
+fontface('xxx', 'xxx/xxx-webfont')
font-family: 'xxx'
function filterKey(key, attr) {
return function(i, index){
if (i[key] == attr) return true;
};
}
//howto
array.filter(filterKey('count', 1));
function sortKey(key) {
return function(a, b){
var x = a[key];
var y = b[key];
if (x > y) return 1;
if (x < y) return -1;
return 0;
};
}
@is8r
is8r / build.sh
Last active August 29, 2015 14:02
#!/bin/sh
DIR=$(cd $(dirname $0); pwd)
cd ${DIR}
zip -r htdocs.zip htdocs
//from http://d.hatena.ne.jp/shunsuk/20100415/1271320619
obj = Struct.new('Obj', :title, :url, :image)
item = obj.new('title', 'url', 'image')
//other
xxx = {
:title => 'gists',
:url => 'https://gist.github.com/'
}
// prefixes mixin
=prefixes($property, $value)
$prefixes: -webkit-, -moz-, -ms-, -o-, ''
@each $prefix in $prefixes
#{$prefix}#{$property}: $value
// howto
=border-radius($value)
+prefixes(border-radius, $value)
#if UNITY_IPHONE
#endif
//html
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
//js
var w = screen.width;
if (w <= 480) document.getElementById("viewport").setAttribute("content", "width=device-width, initial-scale=1, maximum-scale=1");
else document.getElementById("viewport").setAttribute("content", "width=1024, maximum-scale=1");
}