Skip to content

Instantly share code, notes, and snippets.

View rkaneko's full-sized avatar
🎯
Focusing

Ryota Kaneko rkaneko

🎯
Focusing
View GitHub Profile
@rkaneko
rkaneko / flowtype-tagged-union.js
Created March 9, 2017 09:49
flowtype' Tagged Unions examples
/* @flow */
type OneAction = {|
kind: 'one',
type: 'ONE_ACTION',
one: string
|};
type TwoAction = {|
kind: 'two',
@rkaneko
rkaneko / BaseSpringBootApplication.java
Created February 10, 2017 12:11
Testで使用するApplicationContextファイルの設定を共有しやすくするメタアノテーション。これを利用してTest対象ファイルと同じpackageないにTest用ApplicationContextファイルを作成する。
package com.rkaneko.spring.boot;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.boot.autoconfigure.SpringBootApplication;

Why?

I want to support inline code block in remark-react-lowlight project. However, the specs of libraries which remark-react-lowlight depends on unable me to confirm code block is inline or not. Of course, in mdast there are differences between inlinecode and non-inlinecode, but the props bound from remark-react to remark-react-lowlight doesn't contains the differences. The difference is lost procedure to convert mdast to hast, so I don't know how to support inline code block in remark-react-lowlight.

Problems

  1. inline code block

ES2015 generators notes

transpiling

  • WEB DB teppeis先生によると、generatorsはトランスパイルが難しいらしいので、generatorsが動く環境以外では使わないほうが良いとのこと。
\usepackage{listings}
\usepackage{color}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
\lstdefinelanguage{JavaScript}{
keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
keywordstyle=\color{blue}\bfseries,
ndkeywords={class, export, boolean, throw, implements, import, this},

When I publish a post, I get a 422 status error. It seems to fail to request api.github.com/repos/rkaneko/weblog/git/tree?[some id].

  • console log screenshot

screenshot

  • server response
@rkaneko
rkaneko / .vimrc.min
Last active February 22, 2016 06:05
minimal .vimrc
" .vimrc.min
set nobackup " not make backup file
set autoread " read automatically file which is written on the other hand
set noswapfile " not make swap file
set textwidth=0 " not turn up long sentence
set hidden " can open a file editting on the other hand
set backspace=indent,eol,start " remove all with backspace key
set whichwrap=b,s,[,],<,>,~ " moving as screen editor
set showcmd " show command on the status line

Sample Embedded JsFiddle

@rkaneko
rkaneko / InstallingAgOnCentOS.md
Last active November 7, 2022 16:57
Installing ag: the silver searcher on CentOS.

Installing ag on CentOS

Prerequistes

  • libpcre
  • liblzma

Download, build and install

@rkaneko
rkaneko / README.md
Last active August 29, 2015 14:08
Create a jar file containing jruby and compass.