Skip to content

Instantly share code, notes, and snippets.

View RichardBray's full-sized avatar
😎
Fix bug , drink milkshake, code feature, repeat.

Richard Oliver Bray RichardBray

😎
Fix bug , drink milkshake, code feature, repeat.
View GitHub Profile
@RichardBray
RichardBray / stratabot-commands.md
Last active November 27, 2015 13:18
A list of stratabot commands

#Stratabot Commands

##Airfield Searches

stratabot airfield search - search for airfields by icao/iata, name or city

stratabot fly from to <leaving|arriving> <today|tomorrow|on YYYYMMDD> at <local|zulu>

where is <icao/iata> - get information and a map about an airfield

@RichardBray
RichardBray / basic.webpack.config.js
Last active August 18, 2017 16:59
Basic webpack js config
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
var extractPlugin = new ExtractTextPlugin({
filename: 'main.css'
});
module.exports = {
@RichardBray
RichardBray / why-should-you-write-tests.md
Created November 10, 2017 18:19
why-should-you-write-tests.md

Why should you write tests?

alt text

Coming to web development from a design background I understand the need to test the part of the site or web app that the user interacts with which involves testing things like; browser compatibility, usability, regression, and accessibility. However, I wasn't really well diverse in the realm of automated code testing. Terms like 'unit testing', 'integration testing' and '100% test coverage' flew over my head. I didn't see the need to essentially write two times the code to do a test that you could do manually.

As my role (and what is required from a front end dev) has evolved, I've had to delve more into the Javascript side of things and I've seen the benefits of writing tests. There are multiple types of tests one could write and knowing the benefits and disadvantages of them are importan

@RichardBray
RichardBray / webpack.config.js
Created January 10, 2018 10:34
webpack config with linking info
const path = require("path");
module.exports = {
entry: "./src/index.tsx",
output: {
path: path.resolve(__dirname, "build"),
filename: "bundle.js"
},
module: {},
plugins: []
@RichardBray
RichardBray / webpack.config.js
Last active January 10, 2018 10:35
simple webpack starter
module.exports = {
entry: "",
output: {},
module: {},
plugins: []
}
@RichardBray
RichardBray / index.tsx
Created January 10, 2018 10:44
First bit of code for index.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
const ROOT = document.querySelector(".container");
ReactDOM.render(<h1>Hello</h1>, ROOT);
@RichardBray
RichardBray / index.html
Created January 10, 2018 10:52
Simple index.html content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>React Typescript</title>
</head>
<body>
<div class="container"></div>
<script src="/bundle.js"></script>
</body>
@RichardBray
RichardBray / webpack.config.js
Created January 10, 2018 11:07
Adding typescript as a rule in the modules
module: {
rules: [
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
}
]
},
@RichardBray
RichardBray / webpack.config.js
Created January 10, 2018 12:33
first addition to the plugin
plugins: [
new HtmlWebpackPlugin({
template: "./index.html"
})
]
module: {
rules: [
{
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
},
{
enforce: "pre",
test: /\.js$/,
loader: "source-map-loader"