Skip to content

Instantly share code, notes, and snippets.

View iktakahiro's full-sized avatar

Takahiro Ikeuchi iktakahiro

View GitHub Profile
@oukayuka
oukayuka / axiosInterceptor.ts
Last active April 9, 2019 09:17
axios のレスポンスからスネークケースのキーをキャメルケースに変換して、日付をDateTimeオブジェクトにする
import { AxiosResponse } from 'axios';
import { camel } from 'change-case';
import { isArray, isObject, isString } from 'lodash';
import { DateTime } from 'luxon';
export const reform = (
obj: object,
keyConverter: (k: string) => string,
): any => {
if (isArray(obj)) {
@sile
sile / rust_memo.md
Last active April 3, 2019 04:47
2017年6月時点のRustの開発用メモ

2017年6月時点のRustの開発用メモ

注意

  • 特に最新動向を追ったりはしていないので、情報が古い可能性はある

インストール

@wesm87
wesm87 / react-router-4.0.0-alpha.5.d.ts
Created November 21, 2016 14:13
TypeScript definitions for React Router v4 Alpha
/**
* Custom typedef for React Router v4 (WIP).
*/
declare module 'react-router' {
export type Action = 'PUSH' | 'REPLACE' | 'POP';
export type Location = {
pathname: string,
search: string,
@siddontang
siddontang / rint.go
Created September 3, 2015 12:31
round implementation in go
package main
import "fmt"
import "math"
// see http://www.gnu.org/software/libc/manual/html_node/Rounding.html
func rint(x float64) float64 {
v, frac := math.Modf(x)
if x > 0.0 {
if frac > 0.5 || (frac == 0.5 && uint64(v)%2 != 0) {
@tobyzerner
tobyzerner / app.js
Created April 8, 2015 02:38
Mithril ES6 Components
import Component from './component';
class Widget extends Component {
init(ctrl) {
var props = this.props;
ctrl.counter = props.initialValue;
ctrl.increment = function() {
ctrl.counter++;
@jtangelder
jtangelder / server.py
Created December 24, 2014 11:50
Python SimpleHTTPServer with HTML5 pushState support
#!/usr/bin/env python
# execute in the folder you want the server to run
# starts at port 80
import os
import urlparse
import SimpleHTTPServer
import SocketServer