Skip to content

Instantly share code, notes, and snippets.

View tacamy's full-sized avatar
:octocat:

tacamy tacamy

:octocat:
View GitHub Profile
@tacamy
tacamy / cgcount.js
Created July 12, 2017 07:31
CodeGrid Count of Genko
const api = {
uri: {
entry: 'https://app.codegrid.net/api/entry',
author: 'https://app.codegrid.net/api/author',
},
options: {
mode: 'cors',
}
}
const countout = [
@tacamy
tacamy / createMentionText.js
Created June 5, 2017 08:55
Simple Pollで誰が答えてないかを調べてmention用のテキストつくるやつ
// copy & paste text from Simple Poll
const str = ``
const members = [
'tacamy',
'yomotsu',
'armorik83',
'nakajmg',
'cancer',
'cyokodog',
@tacamy
tacamy / gist:e9a5bdbabeb0b8227310
Last active August 29, 2015 14:23
flipsnap.jsの幅100%対応 with jQuery
var $window = $(window);
var $items = $('.items');
var $item = $items.find('.item');
var length = $item.length;
setItemSize();
var flipsnap = Flipsnap('.items');
$window.on('resize', function () {
@tacamy
tacamy / SassMeister-input.sass
Created May 22, 2015 09:56
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
.block
color: red
&__element
color: yellow
&--modifier
@tacamy
tacamy / SassMeister-input.sass
Created May 22, 2015 09:47
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
.block
width: 10px
&__element
width: 100px
height: 100px
@tacamy
tacamy / gist:cf0f239ddbff9e0e28ae
Created February 17, 2015 05:45
Object.createを使わないクラスの継承
function ObjectCreate(o) {
function F() {}
F.prototype = o;
return new F();
}
function Parent(text) {
console.log('called parent');
this.text = text || 'default text';
}
gistってなに・・!
@tacamy
tacamy / gist:951646
Created May 2, 2011 14:06
JavaScript UA Navigator(Android+'Mobile')
if ((navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPod') > 0 || /Android.+Mobile/.test(navigator.userAgent) > 0) {
location.href = '/hoge/';
}
@tacamy
tacamy / devicePixelRatio=1_1.5
Created March 11, 2011 08:12
devicePixelRatio=1.5以上のデバイスには全て2倍サイズの画像を縮小して表示させる。
/* devicePixelRatio=1 & devicePixelRatio未対応ブラウザ */
.className {
width: 100px;
height: 100px;
background: url(test@1x.png); /* 等倍の画像 */
}
/* devicePixelRatio=1.5以上 */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
@tacamy
tacamy / devicePixelRatio=1_1.5_2
Created March 11, 2011 08:09
devicePixelRatio=1/1.5/2のデバイスに1つ1つに対して、3種類のサイズの背景画像を指定する。
/* devicePixelRatio=1 & devicePixelRatio未対応ブラウザ */
.className {
width: 100px;
height: 100px;
background: url(test@1x.png); /* 等倍の画像 */
}
/* devicePixelRatio=1.5 */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {