- 特に最新動向を追ったりはしていないので、情報が古い可能性はある
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom typedef for React Router v4 (WIP). | |
*/ | |
declare module 'react-router' { | |
export type Action = 'PUSH' | 'REPLACE' | 'POP'; | |
export type Location = { | |
pathname: string, | |
search: string, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from './component'; | |
class Widget extends Component { | |
init(ctrl) { | |
var props = this.props; | |
ctrl.counter = props.initialValue; | |
ctrl.increment = function() { | |
ctrl.counter++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |