Skip to content

Instantly share code, notes, and snippets.

Tom Maslen tmaslen

Block or report user

Report or block tmaslen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Example-Readme.md

Project Title

One Paragraph of project description goes here

Overview

Top 5 things about this project

  • List of them
@tmaslen
tmaslen / policy.json
Last active May 24, 2019
AWS IAM Profile with all the required permissions for deploying a Lambda + API Gateway via Cloudformation
View policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:CreateMultipartUpload",
"s3:AbortMultipartUpload"
View start-intellij.sh
/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
@tmaslen
tmaslen / mocha.d.ts
Created Nov 23, 2017
Minimum Typescript definitions for mocha.js
View mocha.d.ts
type Callback = () => void;
export function describe(description: string, callback: Callback);
export function it(description: string, callback: Callback);
View update-image.sh
#!/bin/bash
# Adapted from...
# https://stackoverflow.com/questions/26423515/how-to-automatically-update-your-docker-containers-if-base-images-are-updated
DATAPATH='./data/docker/updater/data'
UNAME="<DOCKER_HUB_USERNAME>"
UPASS="<DOCKER_HUB_PASSWORD>"
@tmaslen
tmaslen / serverless-creation-iam-policy.json
Last active Mar 16, 2017
example IAM policy for creating serverless services from the CLI
View serverless-creation-iam-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:CreateRole",
"iam:CreatePolicy",
"iam:AttachRolePolicy",
"iam:PassRole",
"lambda:GetFunction",
View Lambda-ApiGateway-Cloudformation.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation sample template that contains a single Lambda function behind an API Gateway",
"Resources": {
"GreetingLambda": {
"Type": "AWS::Lambda::Function",
"Properties": {
View dedupeInlineCSS.js
var _ = require( 'lodash' );
module.exports = function ( html ) {
var anyInlineCssTag = new RegExp( '<style type="text/css">[^<]*</style>', 'g' );
var matches = html.match( anyInlineCssTag );
_.uniq( matches ).forEach( function( styleTag ) {
View gist:cd74dcaecbc3e8f4c262067c89e3ad1b
#!/bin/bash
# Create a temp file that runs install instructions on the host
cat > finish-code-deploy.sh <<- EOM
rm -fr tweetgest.com
mkdir tweetgest.com
unzip code-to-deploy.zip -d tweetgest.com
EOM
# Zip up and deploy the code and the install script
View BBC News JavaScript Standard v0.0.md

# BBC News JavaScript Standard v0.0

Contents:

  • Introduction
  • Ensuring availability of JavaScript content for all users
  • JavaScript coding strategies
  • Legal requirements
  • Implementation and optimisation
  • XML HTTP Requests (AJAX)
You can’t perform that action at this time.