Skip to content

Instantly share code, notes, and snippets.

@hail2u
hail2u / bem-vars.scss
Created February 11, 2014 23:16
Define Sass variables with BEM using map.
$searchbox: (
input: (
fg: black,
bg: white,
border: lighten(black, 25%);
--focus: (
border: cyan,
)
);
@hail2u
hail2u / Gruntfile.js
Created February 12, 2014 00:24
$ grunt editでgVimでGruntfile.jsを新しいタブで開くタスク
'use strcit';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json')
});
grunt.registerTask('edit', function () {
grunt.util.spawn({
cmd: 'gvim',
@hail2u
hail2u / test.css
Created February 14, 2014 04:14
Sassの変数名において_と-が同一視される問題について。
.test-foo-bar {
content: "foo_bar"; }
.test-foo_bar {
content: "foo_bar"; }
@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) {
@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 / 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 / test.css
Created March 3, 2014 12:27
&__とか&--のアレ
.foo {
color: red; }
.foo__bar {
color: green; }
.foo--baz {
color: blue; }
@hail2u
hail2u / global.css
Created March 11, 2014 01:14
!global
.test {
color: green; }
.test-global {
color: blue; }
@hail2u
hail2u / test.md
Last active August 29, 2015 13:59
GFMの見出しリンクで削除される文字列を検証

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

  • 小文字に変換される
  • 空白は-に変換される
  • a-zA-Z-_はそのまま
  • Àより前の半角記号はほとんど削除される
    • ただしªµºは残る
  • ソフトハイフンが挙動不審
  • 残りはUTF-8でURLエンコード
@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: