Skip to content

Instantly share code, notes, and snippets.

@amosuro
amosuro / 1. BriefTemplate.js
Last active April 15, 2019 05:54
Brief Templates Model Proposal
// This will be the BriefTemplate model which all Briefs will need to use. A BriefTemplate will always reference a 'type' which will be
// how we identify what further fields to use for that particular Brief.
{
type: {
type: String,
enum: ['WEBSITE', 'ANDROID_APP'],
default: 'WEBSITE'
},
status: {
@amosuro
amosuro / bbc_arabic.scss
Created March 8, 2019 13:00
Font measurements
@import '../utils';
.bbc_arabic {
direction: #{map-deep-get($SCRIPT_TYPE_METRICS,BBC_ARABIC,DIRECTION)};
font-family: #{map-deep-get($SCRIPT_TYPE_METRICS,BBC_ARABIC,FONT_FAMILY)};
#content * {
visibility: visible;
}
@amosuro
amosuro / server.js
Created February 11, 2019 18:01
temp
app.use(express.static(path.join(__dirname, 'client', 'build')));
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'client', 'build', 'index.html'));
});
@amosuro
amosuro / captions.json
Created December 6, 2018 10:20
captions
[
{
"captionURL":"./../webcap/index.html",
"startTime":2,
"duration":58,
"captionData":{
"line1":"one",
"caption":"narrative",
"scriptType":"reith",
"legibilityBackground":"none",
render() {
const {name, email, message} = this.state.fields;
return (
<form ref={this.formElement}
onSubmit={() => this.submitForm()}>
<input type="text"
value={name}
onChange={event => this.onInputChange(event, 'name')}
name="name"
submitForm() {
const {name, email, message} = this.formElement.current.elements;
const payload = {
url: 'api/contact',
name: name,
email: email,
message: message,
};
post(payload)
const post = async (data) => {
const { url } = data;
delete data.url;
const params = {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
// Our end-point for handling the enquiry request
app.post('/api/contact', (req, res, next) => {
return mailer.sendMail('sender@email.com', ['reciever@email.com'], req.body)
.then(() => res.send(req.body))
.catch(next);
});
app.listen(port, () => console.log(`Listening on port ${port}`));
const app = express();
const port = process.env.PORT || 5000;
AWS.config.update({region: 'eu-west-1'}); // Set the region that you configured in AWS
const AWS = require('aws-sdk'); // Load the SDK for JavaScript
const mailer = require("./mailer");
const express = require('express');