Skip to content

Instantly share code, notes, and snippets.

View akameco's full-sized avatar

akameco akameco

  • Japan, Tokyo
View GitHub Profile
let name = ‘ゲスト’
try {
name = awiat getName()
} catch (err) { }
console.log(`ようこそ ${name}さん`)
async function f() {
const x = await g()
}
{
"components.App.hello": "hello {name}",
"components.App.welcome": "Welcome"
}
@akameco
akameco / hello.yml
Last active August 22, 2017 00:16
yaml-flat-loader
hello:
world:
webpack
@akameco
akameco / test.js
Last active August 14, 2017 19:40
mock console.log
// @flow
const sum = (a, b) => a + b
test('sum', () => {
expect(sum(1, 2)).toBe(3)
})
const spyLog = jest.spyOn(console, 'log')
spyLog.mockImplementation(x => x)
@akameco
akameco / App.js
Created July 28, 2017 17:17
Typing Demo
// @flow
import React, { Component } from 'react'
import EventListener from 'react-event-listener'
import lodash from 'lodash'
import catNames from './catNames'
import './App.css'
type TargetType = string
const Target = ({ word, active }: { word: TargetType, active: boolean }) =>
// @flow
import * as I from 'immutable'
export function defineRecord<T: Object>(
name: string,
spec: T
): (init: $Shape<T>) => Record<T> {
return I.Record(spec, name)
}
// @flow
import React from 'react';
import styled, {keyframes, css} from 'styled-components';
function transform(percent: number, scale: number = 1) {
return css`
${percent}% {
transform: scale(${scale});
}
`;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@akameco
akameco / pandas.ipynb
Created February 14, 2017 07:39
pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.