Skip to content

Instantly share code, notes, and snippets.

@hail2u
hail2u / nest-task-list.md
Created May 16, 2014 04:23
nest task list
  • foo
    • foo-foo
    • foo-bar
    • foo-baz
  • bar
@hail2u
hail2u / responsive-code.js
Last active August 29, 2015 14:01
レスポンシブ・コード
var replaceLinkWithCode = function (codeURL, codeRef) {
var request = new XMLHttpRequest();
request.open('get', codeURL, true);
request.addEventListener('load', function () {
var parent = codeRef.parentNode;
var pre = document.createElement('pre');
parent.insertBefore(pre, codeRef);
var code = document.createElement('code');
@hail2u
hail2u / create-swatch.scss
Created May 13, 2014 08:25
Sassの色管理パターン
// Create swatch
$color-base: #33ff33;
$color-accent: #3333ff;
.header {
background-color: $color-base;
}
.header .active {
color: $color-accent;
@hail2u
hail2u / errmsg.txt
Created May 4, 2014 12:57
vim cannot name function prefix with colon
Error detected while processing **************************:
line 1:
E128: Function name must start with a capital or "s:": test:func()
This is a test.
line 3:
@hail2u
hail2u / test.md
Last active August 29, 2015 13:59
GFMの見出しリンクで削除される文字列を検証

Test!"#$%&'()*+,-./0123456789:;=<>?@[\]^_`{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿À

  • 小文字に変換される
  • 空白は-に変換される
  • a-zA-Z-_はそのまま
  • Àより前の半角記号はほとんど削除される
    • ただしªµºは残る
  • ソフトハイフンが挙動不審
  • 残りはUTF-8でURLエンコード
@hail2u
hail2u / global.css
Created March 11, 2014 01:14
!global
.test {
color: green; }
.test-global {
color: blue; }
@hail2u
hail2u / test.css
Created March 3, 2014 12:27
&__とか&--のアレ
.foo {
color: red; }
.foo__bar {
color: green; }
.foo--baz {
color: blue; }
@hail2u
hail2u / sass.vim
Last active August 29, 2015 13:56
~/.vim/after/syntax/sass.vim (support Sass 3.4.0.rc.2)
" !optional
syn match sassOptional "!optional\>" contained
hi def link sassOptional cssImportant
" !global
syn match sassGlobal "!global\>" contained
hi def link sassGlobal cssImportant
" Functions
syn match sassFunction "\<\%(invert\)\>(\@=" contained
@hail2u
hail2u / Custom.css
Last active August 29, 2015 13:56
Feedly v18.0 sucks.
/* Feedly */
#feedlyCenter * {
font-family: "Segoe UI", sans-serif !important;
}
#feedlyCenter code,
#feedlyCenter pre {
font-family: "Consolas", monospace !important;
}
@hail2u
hail2u / Gruntfile.js
Created February 18, 2014 13:01
Load Grunt plugin config from `.grunt/config/*.json` and load Grunt tasks from `package.json`.
'use strcit';
var path = require('path');
module.exports = function (grunt) {
var config = {
pkg: grunt.file.readJSON('package.json')
};
grunt.file.expand('.grunt/config/*.json').forEach(function (file) {