Skip to content

Instantly share code, notes, and snippets.

View ryo33's full-sized avatar

Ryo Hirayama ryo33

View GitHub Profile
#!/usr/bin/env bash
curl -O http://kuina.ch/download/kuina_chan_fusion.mp3
mp3splt -n kuina_chan_fusion.mp3 0.0 3.32 7.04 10.34 13.54 17.16 20.24 24.03 27.13 30.53 34.09 36.59 91.7
mv kuina_chan_fusion_00m_00s__03m_32s.mp3 砂のお城とアイスクリーム.mp3
mv kuina_chan_fusion_03m_32s__07m_04s.mp3 朽ちた時計台.mp3
mv kuina_chan_fusion_07m_04s__10m_34s.mp3 春を運ぶ風.mp3
mv kuina_chan_fusion_10m_34s__13m_54s.mp3 輝く凍土世界.mp3
mv kuina_chan_fusion_13m_54s__17m_16s.mp3 子供の縄張り.mp3
mv kuina_chan_fusion_17m_16s__20m_24s.mp3 獣たちは嵐を駆ける.mp3
mv kuina_chan_fusion_20m_24s__24m_03s.mp3 ペンギンたちの願い.mp3
@ryo33
ryo33 / ilh.py
Last active May 8, 2016 16:38
hubeny
"""
Copyright(c) 2015 ryo hashiguchi
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
"""
import math
import sys
def convert(data):
// State
{
todos: {
todoA: [],
todoB: [],
todoC: []
},
currentTodoKey: "todoA"
}
@ryo33
ryo33 / file0.js
Created August 26, 2016 12:09
Reactで描画回数を制限する(ためのHOCを作った) ref: http://qiita.com/ryo33/items/1c70fd0fb8af2169d159
import throttle from 'react-throttle-render';
const wrappedComponent = throttle(component, 50);
function* before() {
yield fork(function*() {
yield* takeEvery('FETCH_USERS', fetchUsers)
})
yield fork(function*() {
yield* takeEvery('CREATE_USER', createUser)
})
}
function* after() {
yield fork(takeEvery, 'FETCH_USERS', fetchUsers)
@ryo33
ryo33 / saga-relay.js
Last active October 18, 2016 12:35
function* relay(request, relayChannel, nextChannel) {
const result = yield call(request)
yield put(relayChannel, [result, nextChannel])
}
function* runSequencially(requestChannel, resultChannel) {
let head = channel()
let tail = head
while (true) {
const { request, relayResult } = yield race({

Listen History API

Create a token

PUT /api/users/USER_ID

Headers

Content-Type: application/json
import { create as createJsondiffpatch } from 'jsondiffpatch'
import clone from 'clone'
const jsondiffpatch = createJsondiffpatch({})
function reducer(state = {}, action) {
switch (action.type) {
case 'INITIAL_STATE':
const initialState = action.payload
return initialState
@ryo33
ryo33 / 1.md
Last active January 4, 2017 00:14
redux-thunk and redux-middlewares

gaearon/redux-thunk

These examples are not completely compatible about whether to call next(action).

incrementAsync

redux-thunk

function incrementAsync() {
augroup plugin-POWER-mode
autocmd!
autocmd TextChangedI * call s:shake()
autocmd CursorHold,CursorHoldI * call s:restore_pos()
augroup END
command! ShakeOn call s:switch(1)
command! ShakeOff call s:switch(0)
set updatetime=60