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
localStorage.setItem("item", "item"); |
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
// current | |
const [rendered, type] = await (async () => { | |
const articleRenderer = new ArticleRenderer(); | |
const taskRenderer = new TaskRenderer(); | |
if (doc instanceof Article) { | |
return [await articleRenderer.render(doc), 'article']; | |
} else if (doc instanceof Task) { | |
return [await taskRenderer.render(doc), 'task']; |
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 {Server} = require('http'); | |
class KoaError extends Error { | |
constructor(status, message) { | |
super(message); | |
this.status = status; | |
} | |
} | |
module.exports = class Koa { |
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
trait Encoder[From] { | |
type To | |
def encode(from: From): To | |
} | |
object Encoder { | |
type Aux[From, To0] = Encoder[From] { | |
type To = To0 | |
} | |
implicit def compose[A, B, C](implicit e1: Encoder.Aux[A, B], e2: Encoder.Aux[B, C]): Encoder.Aux[A, C] = | |
new Encoder[A] { |
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
{- usage: | |
View.elm | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ link { href = "/lala1", text = "change link" } | |
] | |
-} |
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
class List extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
list: [1, 2, 3, 4, 5] | |
}; | |
} | |
render() { |
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, { Component } from 'react'; | |
import { render } from 'react-dom'; | |
import { times, uniqueId } from 'lodash'; | |
class Fruite { | |
constructor(name) { | |
this.id = uniqueId(); | |
this.name = name; | |
} | |
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 path from 'path'; | |
import webpack, { DefinePlugin, BannerPlugin } from 'webpack'; | |
import merge from 'lodash/object/merge'; | |
import autoprefixer from 'autoprefixer'; | |
import ExtractTextPlugin from 'extract-text-webpack-plugin'; | |
import HtmlWebpackPlugin from 'html-webpack-plugin'; | |
import minimist from 'minimist'; | |
import { getTemplates } from './html'; | |
const parameters = minimist(process.argv.slice(2))._; |
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
it('should return response', async () => { | |
const result = await API.get('/test', {}); | |
expect(result).to.deep.equal({hello: 'world', meta: {status: 200}}); | |
}); |
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
# Dockerfile for %example% project | |
FROM centos:centos7 | |
MAINTAINER Sergey Zelenov <[email protected]> | |
RUN yum update -y | |
# Install EPEL | |
RUN yum install -y epel-release |
NewerOlder