Skip to content

Instantly share code, notes, and snippets.

Avatar

mikesorae mikesorae

View GitHub Profile
@mikesorae
mikesorae / custom_modifications.json
Last active Nov 16, 2020
Karabiner custom modification setting for Japanese with US Keyboard
View custom_modifications.json
{
"title": "US Keyboard for Japanese",
"rules": [
{
"description": "右Optionキーを単体で押したときにかなキーを送信する",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "right_option",
@mikesorae
mikesorae / options.txt
Last active Nov 13, 2020
All Configure Options for PHP 5.6.x
View options.txt
`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 / build.gradle
Created Apr 7, 2020
build.gradle for Kotlin Apache Beam
View build.gradle
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 Sep 9, 2019
SFC version of redux-persist synchronized App Component
View AppProvider.ts
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 Jul 10, 2019
Idris lesson: proof of plus Zero + m = m
View Main.idr
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 Jun 27, 2019
Jenkins with psql and gcc
View Dockerfile
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 Dec 26, 2018
Ring Bell in Haskell (no jummed, not override monad operators)
View RingBell.hs
{-# 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 Dec 17, 2018
State Monad with Elm
View State.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 Sep 26, 2018
Re:VIEWで通しノンブルつけるやつ
View layout.tex.erb
\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 / gist:8050532
Created Dec 20, 2013
get uuid from provisioning profile
View gist:8050532
cat xxxx.mobileprovision | grep -A 1 -a UUID | grep "string" | sed -E "s/.*>([^<]*)<.*/\1/g"
#=> xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx