This file contains 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
function diff(arr1: number[], arr2: number[]) { | |
const uniqueArr1 = arr1.filter(a1 => !arr2.includes(a1)) | |
const uniqueArr2 = arr2.filter(a2 => !arr1.includes(a2)) | |
return [...uniqueArr1, ...uniqueArr2] | |
} | |
const test1 = [[1,4,3,7],[3,4,5]] | |
console.log(diff(test1[0], test1[1])) | |
const test2 = [[1,4,3,7],[3,4,5],[5]] |
This file contains 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
declare module '@emotion/styled' { | |
import styled, { CreateStyled } from '@emotion/styled' | |
import { ThemeType } from '@pulse/types' | |
export default styled as CreateStyled<ThemeType> | |
} |
This file contains 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
function encrypt(text, key, iv) { | |
let cipher = crypto.createCipheriv('aes-128-cbc', key, iv) | |
let encrypted = cipher.update(text) | |
encrypted = Buffer.concat([encrypted, cipher.final()]) | |
return encrypted.toString('base64') | |
} |
This file contains 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
/* @flow */ | |
import React, { Component } from 'react' | |
import Router from 'next/router' | |
import { checkLogin } from '../../redux/modules/auth' | |
type Props = { | |
location: string, | |
} | |
export default ({ location }: Props) => (ComposedComponent: any) => class needLogin extends Component<Object> { |
This file contains 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 React from 'react' | |
import ErrorPage from 'next/error' | |
export default Component => { | |
return class WithError extends React.Component { | |
static async getInitialProps(ctx) { | |
const props = | |
(Component.getInitialProps | |
? await Component.getInitialProps(ctx) | |
: null) || {} |
This file contains 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
const express = require('express') | |
export default function maintenance (app, options) { | |
let mode = false | |
let endpoint = false | |
let url = '/maintenance' | |
let accessKey | |
let view = 'maintenance.html' | |
let api = false | |
let status = 503 |
This file contains 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
/* @flow */ | |
import React, { Component } from 'react' | |
import Head from 'next/head' | |
export default (title: string) => (ComposedComponent: any) => class HeadTitle extends Component<Object> { | |
render () { | |
return [ | |
<Head key='head'><title>{title}</title></Head>, | |
<ComposedComponent key='composedComponent' {...this.props} />, | |
] |
This file contains 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
FROM ubuntu:latest | |
#### Change to bash | |
RUN mv /bin/sh /bin/sh_tmp && ln -s /bin/bash /bin/sh | |
# Setup proxy | |
ENV http_proxy http://hoge.co.jp:10080 | |
ENV https_proxy http://hoge.co.jp:10080 | |
ENV no_proxy localhost | |
This file contains 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
FROM golang:1.9.4-alpine | |
RUN apk update \ | |
&& apk upgrade \ | |
&& apk add --no-cache bash git openssh curl coreutils | |
RUN go get github.com/golang/dep/cmd/dep | |
RUN go get github.com/codegangsta/gin | |
RUN mkdir -p /go/src/github.com/mkamakura/myProject/backend |
This file contains 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
const GifEncoder = require('gifencoder') | |
const pngFileStream = require('png-file-stream') | |
const fs = require('fs') | |
const chalk = require('chalk') | |
const config = require('./config') | |
const baseDir = 'e2e/screenshots/' | |
const dirs = fs.readdirSync(baseDir) | |
const promises = [] | |
dirs.forEach(async (dir) => { |
NewerOlder