Skip to content

Instantly share code, notes, and snippets.

@matori
matori / meta.jade
Last active February 3, 2016 03:18
Jade meta tag mixin
mixin meta(name, content)
-
var attrs = {};
var httpEquivRegExp = /^content-(?:encoding|length|language|type|(?:style|script)-type)|default-style|refresh|set-cookie|pragma|cache-control|expires|allow|date|last-modified|location|www-authenticate|x-(?:ua-compatible|dns-prefetch-control|rim-auto-match)$/i;
var ogpRegExp = /^og:/i;
name = typeof name === "string" ? name.trim() : null;
content = typeof content === "string" ? content.trim() : null;
if name && content
@matori
matori / SassMeister-input.scss
Created January 21, 2016 03:26
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
@media screen { /*! don't remove this comment */ }
@matori
matori / fakeBreak.css
Last active February 18, 2016 09:30
Lettering text mixin for Jade
.fakeBreak::after {
white-space: pre;
content: "\000a";
}
@matori
matori / index.html
Created March 31, 2016 03:54
styleMatchTester.js
<script src="path/to/style-match-tester.js"></script>
<script>
var config = {
"html": {
pseudo: "::before",
prop: {
"display": "block",
"border-top-width": "0",
"font-size": "",
@matori
matori / alphafy.scss
Created April 5, 2016 12:11
Convert colort to alpha
// http://paulownia.hatenablog.com/entry/20100420/1271769659
@function alphafy($front, $back, $alpha) {
$r: round((red($front) - red($back) * (1 - $alpha)) / $alpha);
$g: round((green($front) - green($back) * (1 - $alpha)) / $alpha);
$b: round((blue($front) - blue($back) * (1 - $alpha)) / $alpha);
@if($r < 0) {$r: 0;}
@if($r > 255) {$r: 255}
@if($g < 0) {$g: 0;}
@if($g > 255) {$g: 255}
@if($b < 0) {$b: 0;}
@matori
matori / memo.md
Last active March 8, 2017 01:15
css-text-3 Segment Break Transformation Rules のメモ
function noScrollFocus(element) {
const x = window.scrollX || window.pageXOffset;
const y = window.scrollY || window.pageYOffset;
element.focus();
window.scrollTo(x, y);
}
@matori
matori / browserslist-stats.json
Created May 5, 2017 11:16
browsers share on my site from 2017-04-01 to 2017-05-01
{
"name": "Unformed Building",
"source": "google_analytics",
"dataByBrowser": {
"ie": {
"6": 0,
"7": 0.016210082671421624,
"8": 0.18641595072134867,
"9": 0.09726049602852974,
"10": 0.17020586804992707,
@matori
matori / myrule.json
Last active February 7, 2018 06:57
Karabiner-Elements のカスタムルール
{
"title": "カスタムルール",
"rules": [
{
"description": "右Cmd空打ちでIME切り替え",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
@matori
matori / safe-letters-for-japanese.md
Last active April 26, 2019 13:19
見間違いと聞き間違いを防ぐ英数字を知りたい

1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

見間違い

  • 1 - i - l - I - L
  • 2 - z - Z
  • 5 - s - S
  • 8 - B
  • 9 - q
  • 0 - o - O