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 moment from 'moment'; | |
export function isValidDate(fmt) { | |
let dateFormat = fmt || 'MM/DD/YYYY'; | |
this.passes((newValue) => { | |
let mmt = moment(newValue, dateFormat); | |
return mmt.isValid() && mmt.format(dateFormat) === newValue; | |
}); | |
return this; |
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
/** | |
* Created by ericjohnson on 10/6/15. | |
*/ | |
import moment from 'moment'; | |
export class Storage { | |
constructor() { | |
this.index = {}; | |
this.storage = window.localStorage; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>GistRun</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<h1>Hello world!</h1> | |
<script src="script.js"></script> |
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
/** | |
* Created by ericjohnson on 2/23/16. | |
*/ | |
let model = require('./response-model'), | |
utilities = require('./utilities'), | |
ActionLaunchRequest = require('./action-launch-request'), | |
client = require('api-client'); | |
export function intent(event, context) { |
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
//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){ | |
rules.push(ValidationRules.ensure(field.propName).required().rules[0]) | |
} | |
if (field.required && field.viewIf) { | |
rules.push(ValidationRules.ensure(field.propName).required() |
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
<input type="checkbox" checked.bind="color | checkedValue:'Green':'Blue'" /> |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Deployment Stack' | |
Parameters: | |
GitHubToken: | |
NoEcho: true | |
Type: String | |
Description: Secret. It might look something like 9b189a1654643522561f7b3ebd44a1531a4287af OAuthToken with access to Repo. Go to https://github.com/settings/tokens" | |
GitHubOwner: | |
Type: String | |
Description: GitHub UserName |
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 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}-${Date.now()}`, | |
Tags: [{ Key: 'type', Value: 'snapper' }] |
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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: AWS S3 Hosting bucket and CloudFront Distrobution | |
Resources: | |
## Origin Access ID for CloudFront | |
HostAccessIdentity: | |
Type: "AWS::CloudFront::CloudFrontOriginAccessIdentity" | |
Properties: | |
CloudFrontOriginAccessIdentityConfig: | |
Comment: MyHostBucketId |
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 http = require('http'); | |
const hostname = '0.0.0.0'; | |
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'); | |
}); |
OlderNewer