Skip to content

Instantly share code, notes, and snippets.

View kena0ki's full-sized avatar
🐢

Ken Aoki kena0ki

🐢
View GitHub Profile
@kena0ki
kena0ki / install-vim-from-source-on-MacOS10.15.4.md
Last active April 2, 2020 04:11
install vim from source on MacOS 10.15.4 with python3 and ruby

Prerequirments

  • Xcode command line tools.
  • Python3.
  • Ruby Stable.

Install or Update Vim

Run following script.

#!/bin/zsh -eu
@kena0ki
kena0ki / this.js
Last active March 28, 2020 02:17
I expected fnc prints MyClass, at least the last one, but actually it printed undefined.
'use strict'
function MyClass() {
function fnc() {
console.log(this, 'in fnc');
}
const arrow = () => {
console.log(this, 'in arrow');
}
const bind = function() {
@kena0ki
kena0ki / install-vim-from-source_on_Centos7.sh
Last active April 2, 2020 03:19
install or upgrade vim from source code on Centos 7
#!/bin/bash -eu
#https://www.vim.org/git.php
echo -n "Input work directory (default to home) >> "
read WORKDIR
echo
test -z "$WORKDIR" && WORKDIR=~
test ! -e "$WORKDIR" && mkdir "$WORKDIR"
LOGFILE="$PWD/$WORKDIR"/vim/viminstall.log
@kena0ki
kena0ki / golang.sh
Last active January 12, 2020 08:22
Golang environment variable for Centos (path: /etc/profile.d/golang.sh)
[[ ! "$PATH" =~ "/usr/local/go/bin" ]] && export PATH="$PATH:/usr/local/go/bin"
[[ -z "$GOPATH" ]] && export GOPATH="$HOME/go"
[[ ! "$PATH" =~ "$GOPATH/bin" ]] && export PATH="$PATH:$GOPATH/bin"
@kena0ki
kena0ki / .vimrc
Last active March 28, 2020 12:38
" 一旦ファイルタイプ関連を無効化する
filetype off
" --------------------
" Plugin
" --------------------
" プラグインが実際にインストールされるディレクトリ
let s:dein_dir = expand('~/.vim')
" dein.vim 本体
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
@kena0ki
kena0ki / memo.txt
Last active December 19, 2019 07:55
https://deploy-preview-3342--slatejs.netlify.com/examples/richtext
# https://help.github.com/en/github/getting-started-with-github/fork-a-repo
# https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork
FORKREPO="$1"
ORIGINREPO="$2"
WORKDIR="$3"
git clone "$FORKREPO" "$WORKDIR" # clone forked repo
cd "$WORKDIR"
git remote -v # confirm current configuration
@kena0ki
kena0ki / delayed-cat.js
Last active November 11, 2019 14:54
reads and displays stdin line by line without using @@asyncIterator
const rl = require('readline').createInterface({ input: process.stdin });
const first = { promise: Promise.resolve(), next: null };
const queue = [first];
function asyncReadLine(event, asyncCallback){
rl.on(event, async (...args) => {
queue.push({ promise: new Promise(resolve => void (queue[queue.length - 1].next = resolve)), next: null });
const promiseObj = queue.shift();
await promiseObj.promise;
await asyncCallback(...args);
'use strict';
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');