Skip to content

Instantly share code, notes, and snippets.

View hmsk's full-sized avatar
🍺
Now Brewing

Kengo Hamasaki hmsk

🍺
Now Brewing
View GitHub Profile
{
"meta": { "theme": "short" },
"basics": {
"name": "Kengo Hamasaki",
"label": "Software Developer",
"picture": "https://d1qb2nb5cznatu.cloudfront.net/users/1541642-medium_jpg?1462493251",
"email": "k.hamasaki@gmail.com",
"website": "http://hmsk.me",
"summary": "Kengo is an end to end web engineer from Japan. He started his carrier from DevOps but shifted his primary focus toward Frontend until today through Middleware and Backend. Dove into product management, design, and customer support as a first employee of a fast-growing startup. Current favorite areas are \"payment processing\" and \"static site generation\". Loving OSS development.",
"location": {
@hmsk
hmsk / typescript.js
Last active January 21, 2019 00:00
Simple module to use TypeScript on Nuxt
export default function () {
// Nuxt resolves .ts extension
this.nuxt.options.extensions.push('ts')
// Extend webpack build
this.extendBuild(config => {
// Add ts-loader to import .ts
config.module.rules.push({
test: /\.ts$/,
loader: 'ts-loader',
@hmsk
hmsk / tsconfig.json
Created January 20, 2019 10:01
Typical tsconfig for Nuxt
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "es2015"],
"module": "es2015",
"moduleResolution": "node",
"experimentalDecorators": true,
"noImplicitAny": false,
"noImplicitThis": false,
"strictNullChecks": true,
@hmsk
hmsk / keymap.c
Last active December 24, 2018 04:42
Figma Macros / QMK Keymap for Sweet16 by 1upkeyboard
#include "sweet16.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT_ortho_4x4(
KC_PGUP, KC_PGDN, KC_N, LSFT(KC_N),
LALT(LGUI(KC_L)), LALT(LGUI(KC_T)), LALT(LGUI(KC_R)), LALT(LGUI(KC_J)),
LALT(KC_LT), LALT(KC_GT), LALT(KC_COMMA), LALT(KC_DOT),
LGUI(KC_B), LGUI(KC_I), LGUI(KC_U), KC_NO
)
};
@hmsk
hmsk / stylelint.config.js
Created July 24, 2018 09:05
My compact and efficient Stylelint configuration for Vue project
module.exports = {
processors: [
["@mapbox/stylelint-processor-arbitrary-tags", { fileFilterRegex: [/\.vue$/] }]
],
extends: [
"stylelint-config-standard",
"stylelint-config-recess-order"
],
rules: {
"no-empty-source": null
@hmsk
hmsk / gist:faca4cf551f8547e3d85bdcfe665fd44
Created July 5, 2018 19:07
Run commands in parallel and get exit code as totalized them
cat > cmds << EOF
ls Applications
ls Desktop
ls Music
EOF
cat cmds | xargs -L1 -I BUILD -P3 bash -c BUILD
# -P[thread-num]
@hmsk
hmsk / toggle_audio_output.scpt
Created June 19, 2018 09:04
Toggle output device through System Preferences on macOS
tell application "System Events"
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell
tell application process "System Preferences"
repeat until (exists window "Sound" of application "System Preferences")
delay 1
end repeat
tell tab group 1 of window "Sound"
@hmsk
hmsk / _lang_about.vue
Last active March 1, 2018 06:20
I18n in Nuxt.js
<!-- pages/_lang/about.vue -->
<template>
<div class="Content">
<div class="container">
<h1 class="Content__Title">{{ $t('about.title') }}</h1>
<p>{{ $t('about.introduction') }}</p>
</div>
</div>
</template>
@hmsk
hmsk / about.vue
Last active March 1, 2018 06:18
Determine locale with env variable
<!-- pages/about.vue -->
<template>
<div class="Content">
<div class="container">
<h1 class="Content__Title">{{ $t('about.title') }}</h1>
<p>{{ $t('about.introduction') }}</p>
</div>
</div>
</template>
get '/' do
content_type 'text/xml'
Twilio::TwiML::Response.new do |r|
r.Play WELCOME_MESSAGE_FILE
r.Redirect '/record', method: 'get'
end.text
end
get '/record' do
content_type 'text/xml'