-
var answer = 0.1 + 0.2;
0.30000000000000004
-
var answer = [] + [];
''
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 axios, { AxiosRequestConfig, AxiosError, AxiosResponse, CancelTokenSource } from 'axios'; | |
interface PollOptions<PollResponse, CompleteResponse> { | |
interval: number; | |
shouldContinuePolling: (response: PollResponse | CompleteResponse) => response is PollResponse; | |
isComplete: (response: PollResponse | CompleteResponse) => response is CompleteResponse; | |
onStart?: () => any; | |
onStop?: () => any; | |
onError: (error: AxiosError) => any; | |
onComplete: (response: CompleteResponse) => any; |
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 { connect } from 'react-redux'; | |
import { wrapThunkAction } from './somewhere'; | |
import { action } from './actions'; | |
const wrappedAction = wrapThunkAction(action); | |
interface DispatchProps { | |
action: typeof wrappedAction; |
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
#! /usr/bin/env bash | |
RED="\033[1;31m" | |
GREEN="\033[1;32m" | |
YELLOW="\033[1;33m" | |
COLOR_NONE="\033[1;39m" | |
NVMRC=".nvmrc" | |
function check_node_version () { |
Thursday 5th April, 2018
- [Full info on the Async website][event]
Would you like to speak on the night? You'll have five minutes to tell us about something: a project, a library, a technique, a story, or anything else about JavaScript, HTML, CSS, or the wider world of tech.
ANNOUNCEMENT: We've moved all of these meetups to a better maintained website called Brighton Brains - add it to your bookmarks, share it on your social media, etc. :D
AsyncJS https://asyncjs.com/
A JavaScript meetup for Brighton & Hove
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
/* Tested with TypeScript 2.4.2 */ | |
// If you create an object like this, although the keys are correctly inferred, all of the values will be of type string | |
const obj = { | |
FOO: 'FOO', // FOO: string | |
BAR: 'BAR', // BAR: string | |
}; | |
// You can easily fix this by defining a type for the key values | |
type KeyValue = 'FOO' | 'BAR'; |
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 tsconfig = require('./tsconfig.json'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const ASTERISK = /\*/g; | |
const LEADING_DOT_SLASH = /^\.\//; | |
const CARET = /\^/g; | |
const { compilerOptions: { paths } } = tsconfig; |
- Related tutorial: http://raspberrypiguide.de/
- Command Line Cheatsheet: https://gist.github.com/hofmannsven/8392477