Skip to content

Instantly share code, notes, and snippets.

@pocotan001
pocotan001 / Gruntfile.coffee
Last active December 17, 2015 09:49
Gruntfile.coffee
module.exports = (grunt) ->
config =
pkg: grunt.file.readJSON("package.json")
jshintrc: grunt.file.readJSON(".jshintrc")
banner: "/*! <%= pkg.name %> (<%= grunt.template.today(\"yyyy-mm-dd\") %>) */"
server:
base: "."
startup: "doc/html"
dir:
doc: "doc"
var fp = chrome.loadTimes().firstPaintTime - chrome.loadTimes().startLoadTime;
console.log('First paint: ' + fp);
@pocotan001
pocotan001 / ico.css
Created April 25, 2013 10:50
ico.css
/*
# .ico-
*/
[class^="ico-"]::before,
[class*=" ico-"]::before {
display: inline-block;
content: "";
vertical-align: middle;
}
[class^="ico-"]:not(:empty)::before,

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@pocotan001
pocotan001 / sleep.js
Created April 20, 2013 11:41
sleep.js
/**
* @param {Number} ms
*/
function sleep(ms) {
var end = Date.now() + ms;
while (Date.now() < end);
}
_人人人人人人_
> 突然の死 <
 ̄Y^Y^Y^Y^Y ̄
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
[hidden] { display: none; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-size: 13px; line-height: 1.231; }
body, button, input, select, textarea { font-family: sans-serif; color: #222; }
a { color: #00e; }
a:visited { color: #551a8b; }
a:hover { color: #06e; }
@pocotan001
pocotan001 / setScrollTo.js
Created December 12, 2012 11:48
値の更新を待つscrollToのラッパー(for Android)
/**
* 値の更新を待つscrollToのラッパー(for Android)
*
* @param {Number} x
* @param {Number} y
* @param {[Function]} callback
*/
function setScrollTo(x, y, callback) {
var body = document.body;
@pocotan001
pocotan001 / prefix.js
Created December 11, 2012 11:47
ベンダープレフィックス調べる
var prefix = !getComputedStyle ? null : (function() {
var prefix = null, i = 0,
style = getComputedStyle(document.documentElement, null);
while (style[i++]) {
if (style[i].charAt(0) === '-') {
prefix = style[i].split('-')[1];
break;
}
}
@pocotan001
pocotan001 / global.js
Last active September 27, 2015 03:48
in strict mode.
var global = Function('return this')();