Skip to content

Instantly share code, notes, and snippets.

View yszk0123's full-sized avatar
:octocat:

Yuji Suzuki yszk0123

:octocat:
View GitHub Profile
@yszk0123
yszk0123 / docker-compose.yml
Last active February 28, 2018 22:02
Docker 上で実行した feature spec をデバッグする方法 ref: https://qiita.com/yszk0123/items/840f16ed388fb52b0e21
+ node:
+ container_name: node-test
+ image: node:9.6.1-alpine
+ command: sh -c 'cd /app && yarn init -y && yarn add selenium-webdriver && node test.js'
+ volumes:
+ - ./test.js:/app/test.js
+ networks:
+ test-network:
chrome:
container_name: chrome
@yszk0123
yszk0123 / getEnumKeys.ts
Created August 4, 2018 13:19
TypeScript の enum 型のキーを取り出す
/**
* @example
* enum ErrorCode {
* A = 'a',
* B = 'b'
* }
*
* const errorCodes = getEnumKeys(ErrorCode);
*
* console.log(errorCodes); //=> ['a', 'b']
@yszk0123
yszk0123 / PropTypes.ts
Created September 8, 2018 01:41
Vue.js + TypeScript を使う際に props に Array を渡す方法
/**
* refs. https://github.com/vuejs/vue/pull/6856/files#diff-23d7799dcc9e9be419d28a15348b0d99R129
* @example
* // Your single file component
* import * as PropTypes from '../../PropTypes';
*
* interface Item {
* id: number;
* value: string;
* }
@yszk0123
yszk0123 / watchDataLayerPush.js
Created November 5, 2018 02:00
dataLayer (Google Tag Manager) のデバッグ用ブックマークレット
javascript:(() => {
function printGtmPayload(payload) {
console.table(payload);
}
function watch(target, methodName) {
const originalMethod = target[methodName];
function watchedMethod(...args) {
printGtmPayload(args[0]);
return originalMethod.apply(this, args);
}
@yszk0123
yszk0123 / README.md
Last active January 1, 2020 13:59
Kindleのコンテンツと端末の管理をTSVに変換するブックマークレット