Skip to content

Instantly share code, notes, and snippets.

Eric Johnson singledigit

Block or report user

Report or block singledigit

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
singledigit / vue.config.js
Created Jul 8, 2019
Enable preview and live reloading on Cloud9 with Vue-CLI apps
View vue.config.js
module.exports = {
devServer: {
disableHostCheck: true,
public: 'https://[your cloud9 host id].vfs.cloud9.[region]'
View node8hello.js
const http = require('http');
const hostname = '';
const port = process.env.PORT || 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
singledigit / infrastructure.yaml
Last active Aug 17, 2018
Secure S3 hosting bucket with CloudFront distro. Only allows distro access to the bucket
View infrastructure.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: AWS S3 Hosting bucket and CloudFront Distrobution
## Origin Access ID for CloudFront
Type: "AWS::CloudFront::CloudFrontOriginAccessIdentity"
Comment: MyHostBucketId
singledigit / handler.js
Last active Jun 22, 2018
RDS Snapshot Lambda for automating manual backups.
View handler.js
const AWS = require('aws-sdk');
const rds = new AWS.RDS();
const sns = new AWS.SNS();
const prefix = `snapper-${process.env.TIME_TO_LIVE}-${process.env.TIME_TO_LIVE_METRIC}-${process.env.CLUSTER_ID}`
const createClusterSnapshot = () => {
let params = {
DBClusterIdentifier: process.env.CLUSTER_ID,
DBClusterSnapshotIdentifier: `${prefix}-${}`,
Tags: [{ Key: 'type', Value: 'snapper' }]
singledigit / cognito.yaml
Last active Aug 20, 2019
Create a Cognito Authentication Backend via CloudFormation
View cognito.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Type: String
Description: Unique Auth Name for Cognito Resources
# Creates a role that allows Cognito to send SNS messages
singledigit / Usage
Last active Mar 27, 2017
Aurelia value-converter allowing two string values to be used as a checkbox boolean
View Usage
<input type="checkbox" checked.bind="color | checkedValue:'Green':'Blue'" />
singledigit / Base File
Last active Jun 7, 2018
Cloudformation Files for Creating a Serverless CICD Pipeline
View Base File
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Deployment Stack'
NoEcho: true
Type: String
Description: Secret. It might look something like 9b189a1654643522561f7b3ebd44a1531a4287af OAuthToken with access to Repo. Go to"
Type: String
Description: GitHub UserName
singledigit / aureila-dynamic-validation-rules.js
Last active Oct 11, 2016
Dynamically build Aurelia Validation rules.
View aureila-dynamic-validation-rules.js
//This is a rough attempt at dynamically building validation rules based on a JSON document.
let rules = [];
Forms[this.viewing].map(field => {
if(field.required && !field.viewIf){
if (field.required && field.viewIf) {
singledigit / Activate
Last active Jul 1, 2016
Code examples for Serverless Architecture Demo part 3
View Activate
return this.auth.getSession();
singledigit / Auth Class
Last active May 2, 2018
Pattern for using Cognito User Pools as authentication against Cognito Identity
View Auth Class
import {inject} from 'aurelia-framework';
import {Session} from './session';
export class Auth {
// App specific
userPoolId = 'us-east-1_fgCWraBkF';
appClientId = '57lq262n28o7ddt8i36jcjj7qd';
You can’t perform that action at this time.