Skip to content

Instantly share code, notes, and snippets.

View Leko's full-sized avatar
🏠
Working from home

Shingo Inoue Leko

🏠
Working from home
View GitHub Profile
@Leko
Leko / peco_monorepo.sh
Created February 11, 2019 06:29
Search and change directory with peco in monorepo
peco_monorepo() {
local module_paths=($(node -e 'console.log(module.paths.join(" "))'))
local found=0
for module_paths in ${module_paths[@]}
do
local lerna_bin="$module_paths/.bin/lerna"
if [ ! -f $lerna_bin ]; then
continue
fi
@Leko
Leko / index.js
Last active December 29, 2018 17:25
const licenses = require('./licenses.json')
const osiApprovedLicenses = licenses.filter(l => l.keywords.includes('osi-approved'))
@Leko
Leko / .gitignore
Last active November 13, 2018 10:12
Example of text to speech with VOICELOID(c)
.env
node_modules
@Leko
Leko / README.md
Created November 3, 2018 07:00
DO NOT USE IN PRODUCTION. It can only use for tests.
import assert from './assert'
import { runInTimezone } from './runInTimezone'

const offset = await runInTimezone('Asia/Tokyo', () => new Date().getTimezoneOffset())
assert.strictEquals(offset, -540)
// @flow
import { h, render, Text, Fragment, Component } from "ink";
import Spinner from "ink-spinner";
import chalk from "chalk";
import emoji from "node-emoji";
import { Provider, connect } from "ink-redux";
import { createStore } from "redux";
const Line = ({ text }) => (
<div>
@Leko
Leko / Dockerfile
Created April 29, 2018 03:42
Run Jupyter notebook with Keras for CPU only arch (ex. MacOS)
ARG cuda_version=9.0
ARG cudnn_version=7
FROM debian:stretch
# Install system packages
RUN apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
g++ \
git \
graphviz \
@Leko
Leko / build-ios
Last active September 6, 2017 01:52
Build ReactNative application via CLI
#!/usr/bin/env bash
# Usage:
# build-ios <SCHEME> <EXPORT_PLIST>
#
# SCHEME:
# EXPORT_PLIST:
set -eu
SCHEME=$1
class Avatar {
constructor (uri) {
this.setUri(uri)
Object.freeze(this)
}
setUri (uri) {
this.uri = uri
}
@Leko
Leko / 0_profilify.js
Last active August 21, 2017 02:45
Any function profiling
function profilify(fn, label) {
var displayName = label || fn.name,
called = 0,
profilified = function() {
var args = [].slice.call(arguments),
startedAt = new Date(),
defaults = { total: 0, times: 0, average: 0 },
ret;
profilify._stats[displayName] = profilify._stats[displayName] || defaults