Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Yasuo Fukuda sigwyg

:octocat:
View GitHub Profile
@sigwyg
sigwyg / README.md
Last active Jul 30, 2020
Gherkin Keymaps
View README.md

Gherkin Keymap

  1. https://config.qmk.fm/
    1. import JSON
    2. キーマップを編集
    3. COMPILE
    4. FIRMWARE押すと.hexファイルを入手
  2. QMK Toolbox
    1. .hexをOpen
  3. Reset -> Flash
@sigwyg
sigwyg / pointOrder.js
Created Feb 3, 2020
指定したIDのアイテムだけソート(未指定のIDの順番は維持する)
View pointOrder.js
/**
* order指定されてないアイテムの順番を維持して、
* 指定アイテムのみソート
*
* @param {array} cards
* @param {array} array of card.id
* @return {array} sorted cards
*/
pointOrder(items, order) {
// console.log('order:', order)
@sigwyg
sigwyg / Timer.test.js
Last active Jan 20, 2020
タイマー・コンポーネントのテスト(Vue + Jestの場合)
View Timer.test.js
describe('destroy()の挙動', () => {
test('clearIntervalされているかどうか', () => {
// globalメソッドを上書きして、intervalIDを記録する
let intervals = []
window.mockSetInterval = window.setInterval
window.setInterval = function(func, interval) {
const intervalId = window.mockSetInterval(func, interval)
intervals = [...intervals, intervalId]
//console.log('window.setInterval:', intervalId, intervals)
return intervalId
View .eslintrc.js
module.exports = {
extends: [
'eslint:recommended',
'@nuxtjs/eslint-config-typescript',
'plugin:vue/recommended',
'plugin:nuxt/recommended',
'plugin:prettier/recommended',
'prettier/vue',
],
plugins: ['vue'],
@sigwyg
sigwyg / fetch-example.js
Last active Jan 7, 2019
Fetch API cheatsheet
View fetch-example.js
/**
* URLを叩いた結果で振り分ける。modal出すか、画面遷移するか。
* @param {String} url
*/
(async () => {
try {
const fetchUrl = encodeURIComponent(url);
const response = await fetch(fetchUrl);
const data = await response.json();
@sigwyg
sigwyg / mysql56.sh
Created Dec 31, 2018
macににMySQL5.6(だけを)入れる
View mysql56.sh
rm -rf /usr/local/var/mysql
brew remove --force mysql
brew remove --force mysql@5.6
brew install mysql@5.6
mysql.server start
View .bash_profile
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
@sigwyg
sigwyg / .gitignore
Last active Jun 4, 2018
WordPress: Contact Form 7の送信データをGoogle Sheetに追記する
View .gitignore
vendor/
client_secret.json
composer.phar
View dein.toml
[[plugins]]
repo = 'sbdchd/neoformat.git'
hook_add = '''
"let g:neoformat_verbose = 1 " only affects the verbosity of Neoformat
" Enable tab to spaces conversion
let g:neoformat_basic_format_retab = 1
" Enable trimmming of trailing whitespace
let g:neoformat_basic_format_trim = 1
@sigwyg
sigwyg / .eslintrc.json
Created Jan 19, 2018
ESLint セミコロン書くか書かないか設定
View .eslintrc.json
// requires semicolons
{
"semi": ["error", "always"],
"semi-spacing": ["error", {"after": true, "before": false}],
"semi-style": ["error", "last"],
"no-extra-semi": "error",
"no-unexpected-multiline": "error",
"no-unreachable": "error"
}