Skip to content

Instantly share code, notes, and snippets.

View mikesorae's full-sized avatar

Jumpei Nishina mikesorae

View GitHub Profile
@mikesorae
mikesorae / options.txt
Last active November 13, 2020 03:11
All Configure Options for PHP 5.6.x
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
@mikesorae
mikesorae / custom_modifications.json
Last active November 16, 2020 08:04
Karabiner custom modification setting for Japanese with US Keyboard
{
"title": "US Keyboard for Japanese",
"rules": [
{
"description": "右Optionキーを単体で押したときにかなキーを送信する",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "right_option",
@mikesorae
mikesorae / build.gradle
Created April 7, 2020 23:36
build.gradle for Kotlin Apache Beam
buildscript {
ext.kotlin_version = '1.3.41'
ext.beam_version = '2.19.0'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
@mikesorae
mikesorae / AppProvider.ts
Created September 9, 2019 01:37
SFC version of redux-persist synchronized App Component
import React, { useEffect, useState } from 'react';
import { Provider } from 'react-redux';
import { CircularProgress } from '@material-ui/core'; // replace to any loader component as you like
import configureStore from './Store'; // your redux store
// redux-persistのrehydrationがreactのinitよりも遅いので
// 初期化を遅延させるためのコンポーネント
export const AppProvider: React.SFC<{ children: any }> = ({ children }) => {
const [rehydrated, setRehydrated] = useState(false);
const [config, setConfig] = useState<ReturnType<typeof configureStore> | null>(null);
@mikesorae
mikesorae / Main.idr
Created July 10, 2019 06:20
Idris lesson: proof of plus Zero + m = m
module Main
data N = Zero | Succ N
add : N -> N -> N
add Zero right = right
add (Succ left) right = Succ (add left right)
plusZeroRightNat : ( right : N ) -> add Zero right = right
plusZeroRightNat Zero = Refl
@mikesorae
mikesorae / Dockerfile
Created June 27, 2019 06:46
Jenkins with psql and gcc
FROM jenkins/jenkins:lts
ARG user=jenkins
USER root
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
RUN apt-get install -y postgresql-client
@mikesorae
mikesorae / RingBell.hs
Created December 26, 2018 17:07
Ring Bell in Haskell (no jummed, not override monad operators)
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# language RankNTypes #-}
data DoorState = DoorClosed | DoorOpen
deriving Show
data DoorCmd before end a where
Open :: DoorCmd DoorClosed DoorOpen ()
@mikesorae
mikesorae / State.elm
Created December 17, 2018 02:11
State Monad with Elm
module ElmState exposing (..)
type State s a
= State (s -> ( a, s ))
push : a -> State (List a) ()
push a =
State (\xs -> ( (), a :: xs ))
@mikesorae
mikesorae / layout.tex.erb
Created September 26, 2018 09:18
Re:VIEWで通しノンブルつけるやつ
\documentclass[dvipdfmx,<%= @documentclassoption %>]{<%= @documentclass %>}
% %% fixes to LaTeX2e
% \usepackage{fix-cm}[2006/09/13 v1.1m]
% \usepackage{fixltx2e}[2006/09/13 v1.1m]
<%- if @texcompiler == "uplatex" -%>
\usepackage[deluxe,uplatex]{otf}
<%- else -%>
\usepackage[deluxe]{otf}
<%- end -%>
@mikesorae
mikesorae / git-mv-lower.sh
Last active April 26, 2016 09:42
make a git tracked file lower
#!/bin/sh
if [ $# -eq 0 ]; then
echo "you need to pass a file or directory name to the command"
exit 1
fi
if [ ! -e $1 ]; then
echo "file not exists"
exit 1