Skip to content

Instantly share code, notes, and snippets.

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 / 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,
var fp = chrome.loadTimes().firstPaintTime - chrome.loadTimes().startLoadTime;
console.log('First paint: ' + fp);
@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"
/**
* @param {String} type [http://goo.gl/B5k5w]
* @param {Mix} object
* @return {Boolean}
*/
function is(type, object) {
var klass = Object.prototype.toString.call(object).slice(8, -1);
return object !== undefined && object !== null && klass === type;
}
@pocotan001
pocotan001 / hereDoc.js
Created May 18, 2013 17:55
hereDoc.js
define(function() {return function(){/**
Here document
*/}.toString().slice(15, -3)});
@pocotan001
pocotan001 / globals.snippets.js
Last active April 29, 2023 15:03
Finding improper JavaScript globals.
// globals.js
// https://gist.github.com/pocotan001/6305714
// Finding improper JavaScript globals
(function() {
var prop, cleanWindow,
globals = new function globals() {},
body = document.body,
iframe = document.createElement('iframe'),
ignore = {
@pocotan001
pocotan001 / state.css
Created April 16, 2014 07:00
Global state rules.
.is-invisible {
visibility: hidden !important;
}
.is-hidden {
display: none !important;
visibility: hidden !important; /* for screenreaders */
}
.is-hidden-visually {
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug