Skip to content

Instantly share code, notes, and snippets.

View tylr's full-sized avatar

Tyler Love tylr

View GitHub Profile
class BustleModel < Ohm::Model
include ActiveModel::Validations
def save
return false unless valid?
super
end
end
class Channel < BustleModel
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client();
var eventPattern = /([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\"/;
exports.handler = function(data, context) {
var events = [];
var encodedEvent, rawEvent,
matchedEvent, event, i,
commands;
@tylr
tylr / server.js
Last active January 19, 2016 00:15
Running Ember FastBoot in AWS Lambda
var path = require('path');
var FastBootServer = require('./lib/models/server');
var outputPath = 'fastboot-dist';
var appName = 'dummy';
var server = new FastBootServer({
appFile: findAppFile(outputPath, appName),
vendorFile: findVendorFile(outputPath),
htmlFile: findHTMLFile(outputPath)
});
@tylr
tylr / get-revision.js
Created July 16, 2016 22:15
ember-cli-deploy integration with dynamodb
import AWS from 'aws-sdk'
import Promise from 'bluebird'
const env = global.env.env
const ddb = new AWS.DynamoDB({ region: 'us-east-1' })
const TableName = global.env.dynamodb.TableName
const revisionPrefix = global.env.revisionPrefix
const revisionEnv = env === 'development' ? 'beta' : env
export default ({ revision = null } = {}) => {