Skip to content

Instantly share code, notes, and snippets.

@hail2u
hail2u / eslint-wrapper-wishlist.md
Created October 20, 2015 10:31
ESLintラッパーとして欲しいもの
  • "extend": "eslint:recommended" とか書かなくて良い
    • これ以外許容しないみたいな感じでも良い
    • カスタマイズはさせてくれ
  • "root": true とか書かなくて良い
    • GitやMercurialのルートで止まってほしい
  • --no-ignore とか指定しなくて良い
    • JSじゃなかったら落ちて欲しい
  • フォーマッターを別にして欲しい
@hail2u
hail2u / namegen.js
Created October 17, 2015 15:16
姓名をランダムに作る奴(100*100)
var m = ["三浦", "上田", "上野", "中山", "中島", "中川", "中村", "中野", "丸山",
"久保", "井上", "今井", "伊藤", "佐々木", "佐藤", "佐野", "内田", "前田",
"加藤", "千葉", "原", "原田", "吉田", "和田", "坂本", "増田", "大塚", "大野",
"太田", "安藤", "宮崎", "宮本", "小山", "小島", "小川", "小林", "小野",
"山下", "山口", "山崎", "山本", "山田", "岡本", "岡田", "岩崎", "工藤",
"平野", "後藤", "斉藤", "斎藤", "新井", "木下", "木村", "杉山", "村上",
"村田", "松井", "松尾", "松本", "松田", "林", "柴田", "森", "森田", "横山",
"橋本", "武田", "池田", "河野", "清水", "渡辺", "渡部", "田中", "田村",
"石井", "石川", "石田", "福田", "竹内", "菅原", "菊地", "藤井", "藤原",
"藤本", "藤田", "西村", "谷口", "近藤", "遠藤", "酒井", "野口", "野村",
@hail2u
hail2u / bar.txt
Last active October 15, 2015 14:09
インクルードしてセクションにくくってくれて適宜`hr`で戻してくれるみたいなMarkdownプリプロセッサーが欲しい
# Bar
This paragraph comes from "bar".
@hail2u
hail2u / css-properties-and-MY-pronunciation.markdown
Last active June 26, 2016 01:42
CSSプロパティーとその*僕の*発音
プロパティー 発音
background-attachment バックグラウンド・アタッチメント
background-color バックグラウンド・カラー
background-image バックグラウンド・イメージ
background-position バックグラウンド・ポジション
background-repeat バックグラウンド・リピート
background バックグラウンド
border-collapse ボーダー・コラプス
border-color ボーダー・カラー
@hail2u
hail2u / svg-gradient.scss
Created June 15, 2015 10:35
SVGの線形グラデーションを生成するSCSS関数
@function encode-color($color) {
$str_color: "" + $color;
// if $color is #ffffff
@if (str-index($str_color, "#") == 1) {
$str_color: "%23" + str-slice($str_color, 2);
}
// if $color is rgba(255, 255, 255, 1)
@if (str-index($str_color, "rgba") == 1) {
@hail2u
hail2u / index.js
Last active August 29, 2015 14:22
Source Maps Splitting test
"use strict";
var fs = require("fs");
var postcss = require("postcss");
var input = fs.readFileSync("test.css");
var output = function (result) {
fs.writeFileSync(result.opts.to, result.css);
if (result.opts.map && result.map) {
@hail2u
hail2u / scss-lint.sh
Last active August 29, 2015 14:21
.scss-lint.ymlをGitルートから拾ってscss-lintを実行するシェルスクリプト
#!/bin/sh
bin=${GEM_HOME}/bin/scss-lint
root=`git rev-parse --show-cdup`
conf=${root}.scss-lint.yml
if [ $? -eq 0 ] && [ -e $conf ]; then
${bin} -c ${conf} $*
else
${bin} $*
@hail2u
hail2u / cssfmt
Created May 20, 2015 22:31
cssfmt
#!/usr/bin/env node
"use strict";
var fs = require("fs");
var postcss = require("postcss");
console.log(postcss().use(postcss.plugin("fmt", function () {
return function (css) {
return css.clone();
@hail2u
hail2u / git-run.sh
Created April 18, 2015 18:23
git runって間違えた時にnpm runにすり替えるやつ
# git wrapper
git() {
if [ "$1" = "run" ]; then
$(which npm) run $*
else
$(which git) $*
fi
}
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta content="width=device-width" name="viewport">
<title>dskd</title>
<link href="http://dskd.jp/" rel="canonical">
<link href="apple-touch-icon.png" rel="apple-touch-icon-precomposed">