Skip to content

Instantly share code, notes, and snippets.

@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 {
@pocotan001
pocotan001 / designer.html
Created September 14, 2014 15:35
designer
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
/**
* forked from canon-jenkins
* https://github.com/rackerlabs/canon-jenkins
*/
body {
background: none repeat scroll 0 0 #333;
color: #999;
font-size: 13px;
font-family: "Helvetica Neue",sans-serif;
@pocotan001
pocotan001 / .zshrc
Last active August 29, 2015 14:07
Highlight a given file and copy it as RTF.
# requires highlight `brew install highlight`
function hlcopy() {
if [ -z "$2" ]; then
src="pbpaste"
else
src="cat $2"
fi
$src | highlight -O rtf --syntax $1 --style _${1} --font Menlo --font-size 38 | pbcopy
/**
* @see http://bonsaiden.github.io/JavaScript-Garden/#types.typeof
* @param {*} object
* @return {string}
*/
function toType(object) {
return Object.prototype.toString.call(object).slice(8, -1).toLowerCase();
}
@pocotan001
pocotan001 / gist:1180581
Created August 30, 2011 10:02 — forked from ahomu/gist:877105
わくわくjQuery編
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>わくわくjQuery編</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script >
<script type="text/javascript">
$(function()
{
// ★ 画像の読み込みをテキトーに待つよ
@pocotan001
pocotan001 / gist:1183608
Created August 31, 2011 14:02
Utilities
/**
* getElementById wrapper.
* @param {String} 要素の一意のIDを表す文字列
* @returns {Element} 一致する要素
*/
function $(id){
return $[id] || ($[id] = document.getElementById(id));
}
/**
@pocotan001
pocotan001 / gist:1183673
Created August 31, 2011 14:29
ブックマークレット: ファーストビュー確認用(550px)
javascript:(function(){var d=document,o=d.createElement('div');with(o.style){position='fixed';top='550px';left='0';width='100%';height='100%';borderTop='1px #f00 solid';backgroundColor='rgba(255,255,255,.9)';color='#fff';fontSize='10px';zIndex='10000';}o.innerHTML='<p style='position:absolute;top:0;left:0;margin:0;padding:0pt 8px;background-color:#f00;'>550px</p>';d.body.appendChild(o);})();
// Uncompressed
javascript:
(function(){
var d = document,
o = d.createElement('div');
with(o.style){
@pocotan001
pocotan001 / gist:1183656
Created August 31, 2011 14:19
ブックマークレット: グローバル変数を一覧(alert,consoleに出力)
javascript:(function(){var d=document,f=d.createElement('iframe'),b=d.body,o={0:1,getInterface:1,GetWeakReference:1,console:1,loadFirebugConsole:1,_createFirebugConsole:1,_firebug:1,_FirebugCommandLine:1},c=typeof this.console!='undefined',r='';f.src=d.URL+'?';b.appendChild(f);var w=f.contentWindow;for(var i in this){if(!(i in w)&&!o[i]&&!/^script\d{13}$/.test(i)){r+=i+'\n';if(c)console.log(i+':',this[i]);}}b.removeChild(f);alert(r);})();
// Uncompressed
javascript:
(function(){
var d = document,
f = d.createElement('iframe'),
b = d.body,
o = {
@pocotan001
pocotan001 / global.js
Last active September 27, 2015 03:48
in strict mode.
var global = Function('return this')();