Skip to content

Instantly share code, notes, and snippets.

@hail2u
hail2u / bem-vars.scss
Created Feb 11, 2014
Define Sass variables with BEM using map.
View bem-vars.scss
$searchbox: (
input: (
fg: black,
bg: white,
border: lighten(black, 25%);
--focus: (
border: cyan,
)
);
@hail2u
hail2u / Gruntfile.js
Created Feb 12, 2014
$ grunt editでgVimでGruntfile.jsを新しいタブで開くタスク
View 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 Feb 14, 2014
Sassの変数名において_と-が同一視される問題について。
View test.css
.test-foo-bar {
content: "foo_bar"; }
.test-foo_bar {
content: "foo_bar"; }
@hail2u
hail2u / Gruntfile.js
Created Feb 18, 2014
Load Grunt plugin config from `.grunt/config/*.json` and load Grunt tasks from `package.json`.
View Gruntfile.js
'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 Aug 29, 2015
Feedly v18.0 sucks.
View Custom.css
/* Feedly */
#feedlyCenter * {
font-family: "Segoe UI", sans-serif !important;
}
#feedlyCenter code,
#feedlyCenter pre {
font-family: "Consolas", monospace !important;
}
@hail2u
hail2u / sass.vim
Last active Aug 29, 2015
~/.vim/after/syntax/sass.vim (support Sass 3.4.0.rc.2)
View sass.vim
" !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 Mar 3, 2014
&__とか&--のアレ
View test.css
.foo {
color: red; }
.foo__bar {
color: green; }
.foo--baz {
color: blue; }
View global.css
.test {
color: green; }
.test-global {
color: blue; }
@hail2u
hail2u / test.md
Last active Aug 29, 2015
GFMの見出しリンクで削除される文字列を検証
View test.md

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

  • 小文字に変換される
  • 空白は-に変換される
  • a-zA-Z-_はそのまま
  • Àより前の半角記号はほとんど削除される
    • ただしªµºは残る
  • ソフトハイフンが挙動不審
  • 残りはUTF-8でURLエンコード
@hail2u
hail2u / errmsg.txt
Created May 4, 2014
vim cannot name function prefix with colon
View errmsg.txt
Error detected while processing **************************:
line 1:
E128: Function name must start with a capital or "s:": test:func()
This is a test.
line 3:
You can’t perform that action at this time.