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
| async function getX() { | |
| let users = []; | |
| try { | |
| x = await getUsers(); | |
| } catch (e) { } | |
| return x; | |
| } | |
| // vs |
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
| const path = require('path'); | |
| const webpack = require('webpack'); | |
| const HTMLPlugin = require('webpack-html-plugin'); | |
| const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
| const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
| const basePath = path.resolve(__dirname, './app/'); | |
| const outPath = path.resolve(__dirname, './dist'); | |
| module.exports = { |
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
Show hidden characters
| { | |
| "extends": "airbnb", | |
| "parser": "babel-eslint", | |
| "parserOptions": { | |
| "ecmaFeatures": { | |
| "jsx": true | |
| } | |
| }, | |
| "envs": { | |
| "es6": true, |
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 React, { Component, PropTypes } from 'react'; | |
| export default class List extends Component { | |
| static propTypes = { | |
| data: PropTypes.func.isRequired, | |
| retrieve: PropTypes.func.isRequired, | |
| children: PropTypes.func.isRequired, | |
| isFetching: PropTypes.bool.isRequired, | |
| }; |
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 React, { Component, PropTypes } from 'react'; | |
| export default class LinkModal extends Component { | |
| static propTypes = { | |
| show: PropTypes.func.isRequired, | |
| close: PropTypes.func.isRequired, | |
| link: PropTypes.string.isRequired, | |
| }; | |
| state = { clipboard: null }; |
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
| // @flow | |
| export const OPEN = 'sidebar/OPEN'; | |
| export const CLOSE = 'sidebar/CLOSE'; | |
| export function open(): { type: string } { | |
| return { type: OPEN }; | |
| } | |
| export function close(): { type: string } { | |
| return { type: CLOSE }; |
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
| // current user is { id: 1 } | |
| [{ | |
| id: 1, | |
| users: [{ | |
| id: 1, | |
| name: 'Cat', | |
| online: true, | |
| }, { | |
| id: 2, | |
| name: 'Dog', |
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
| const config = require('../knexfile'); | |
| const env = process.env.NODE_ENV || 'development'; | |
| const { connection: { database, user, password } } = config[env]; | |
| exports.up = function (knex, Promise) { | |
| return knex.raw(`CREATE USER ${user} WITH PASSWORD ${password} CREATEDB`) | |
| .then(() => knex.raw(`CREATE DATABASE IF NOT EXISTS ${connection}`)) | |
| .then(() => Promise.all([ | |
| knex.schema.createTable('users', function (table) { |
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 click | |
| from flask.cli import AppGroup | |
| @click.command(cls=AppGroup) | |
| def cli(): | |
| " Manage the regions " | |
| @cli.command() | |
| @click.argument('region_id') | |
| def broadcast_weather_report(region_id): |
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 enum | |
| from weather import db | |
| class StatesType(enum.Enum): | |
| Alabama = "Alabama" | |
| Alaska = "Alaska" | |
| Arizona = "Arizona" | |
| Arkansas = "Arkansas" | |
| California = "California" | |
| Colorado = "Colorado" |