Skip to content

Instantly share code, notes, and snippets.

View t32k's full-sized avatar
:octocat:
Working from home

t32k t32k

:octocat:
Working from home
View GitHub Profile
setDOMElement
Sets the attribute of a DOM element that is required for the next event to complete successfully. The measurement will not complete until the DOM element appears or the action times out. Additionally, the time when the DOM element appears will be recorded in the results.
Browser Support: IE, Chrome, Firefox
usage: setDOMElement <attribute=value>
example: setDOMElement name'loginId
<attribute=value> - DOM element to wait for

Cron Pattern

Definition

A date and time format that determines when to run a scheduled job.

Structure

@t32k
t32k / modern-development-workflow-with-grunt.md
Last active December 29, 2015 12:19
HTML5 Conference 2013:今どきのGruntを使ったフロントエンド開発(HTML/CSS編)

Slide

SassなどのCSSプリプロセッサを使うWebデザイナが増えてきました。Sassをコンパイルするだけなら黒い画面(ターミナル)を使わずともGUIアプリからの利用で問題ありません。が、ここは一歩踏み込んでGrunt(JavaScript製のタスクランナー)を使って、Sass以外のコンパイルやライブリロード、画像最適化、CSSのリントやスタイルガイド生成など、あらゆる作業をGruntに任せてより効率的な開発環境を手に入れてみませんか。


@t32k

<script id="js-gaq">
var _gaq = [['_setAccount', 'UA-xxxx-x'], ['_trackPageview']];
(function (d) {
var g = d.createElement('script'),s = d.getElementById('js-gaq');
g.src = '//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g, s)
}(document));
</script>
@t32k
t32k / favicon.md
Last active December 22, 2015 23:19
The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 35 best practices divided into 7 categories.

favicon.icoはキャッシュ可能かつ軽量にする

タグ: 画像

画像であるfavicon.icoはサーバーのルートにあります。たとえファビコンを用意してなくても、ブラウザはそれをリクエストし続ける弊害をもたらしますので、404 Not Foundを返すべきではありません。また同一サーバー上にあるため、クッキーはリクエストがあるたびに送られます。このファビコンはダウンロードシークエンスを妨げます。例えばIEにおいて、onloadのタイミングでなにか特別にコンポーネントをリクエストするときに、そのコンポーネントの前にファビコンがダウンロードされます。

ファビコンのデメリット最小限にするために、以下のことを確認して下さい。

  • 可能な限り、軽量にしてください。1KB以下が望ましいです。
  • 適切な期間でExpiresヘッダを設定してください(なぜならファビコンを変更しようと思ってもファイル名を変更できないため)。数ヶ月後のExpiresヘッダを設定すれば比較的安全かと思います。数値に基づいた判断をするために現在のファビコンの最終更新日時を確認することが出来ます。
@t32k
t32k / shell.sh
Last active December 21, 2015 22:09
わたし・よく・わすれる・こまんど・まとめ・おきば
# Check for SSH keys
cd ~/.ssh
ls
# Generate a new SSH key
ssh-keygen -t rsa -C "your_email@example.com"
# Copy
pbcopy < ~/.ssh/id_rsa.pub
@t32k
t32k / address.txt
Created August 9, 2013 03:21
例示用のIPアドレス
192.0.2.0/24
198.51.100.0/24
203.0.112.0/24
@t32k
t32k / adjective.md
Created July 25, 2013 12:49
使えそうな英語の形容詞

primary, secondary, tertiary, quaternary, quinary, senary, septenary, octonary, novenary, decenary

alph, beta, gamma, delta, epsilon, zeta, eta, theta, iota, kappa

loud, quiet, bare, positive, negative, firm, contrast, sharp, opaque, neutral, main, secondary, alert, success, highlight, shiny, dark

@t32k
t32k / custom-sort-order.json
Last active December 20, 2015 02:49
test_custom_sort_order
{
"sort_order": [
"-webkit-flex-align",
"-moz-flex-align",
"-ms-flex-align",
"-o-flex-align",
"flex-align",
"overflow",
"-ms-overflow-x",
"-ms-overflow-y",
// Log min and max info
function minMaxGzip(src) {
return src ? require('gzip-js').zip(src, {}) : '';
}
exports.minMaxInfo = function(min, max) {
var gzipSize = String(minMaxGzip(min).length);
grunt.log.writeln('Uncompressed size: ' + String(max.length).green + ' bytes.');
grunt.log.writeln('Compressed size: ' + gzipSize.green + ' bytes gzipped (' + String(min.length).green + ' bytes minified).');
};