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
@t32k
t32k / gist:1018296
Created June 10, 2011 05:45
Google Analytics for jQuery Mobile
//set
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxx-x']);
//async
(function () {
var ga = document.createElement('script');
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
@t32k
t32k / gist:4023070
Created November 6, 2012 06:42
Compass reset
@charset "UTF-8";
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
数を減らす
HTTPリクエストを減らす
ExpiresまたはCache-Controlヘッダーを追加する
DNSルックアップを減らす
リダイレクトを避ける
重複スクリプトを取り除く
Ajaxをキャッシュ可能にする
AjaxリクスとはGETを使用する
コンポーネントの後読みする
コンポーネントの先読みする
// Usage: @include sprites($map-tabs, common, true);
@mixin sprites($map, $map-item, $isCommon:false) {
@if $isCommon {
background-image: sprite-url($map);
background-size: round(image-width(sprite-path($map)) / 2) round(image-height(sprite-path($map)) / 2);
background-repeat: no-repeat;
} @else {
$pos-y: round(nth(sprite-position($map, $map-item), 2) / 2);
width: round(image-width(sprite-file($map, $map-item)) / 2);
height: round(image-height(sprite-file($map, $map-item)) / 2);
@t32k
t32k / gist:4593169
Last active December 11, 2015 11:19
Cancellation of last item border.
<ul class="listview has-line">
<li>foo</li>
<li>bar</li>
<li>baz</li> <!-- want to cancell this border -->
</ul>
// 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).');
};
@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",
@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 / 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 / wpt.md
Last active April 29, 2023 14:56
Test a website's performance♪