Skip to content

Instantly share code, notes, and snippets.

@justinsoliz
justinsoliz / lambda_kinesis_handler.js
Last active December 3, 2021 10:19
Terraform with lambda and kinesis
// applications/kinesis_streamer/lib/handler.js
import AWS from 'aws-sdk';
const kinesis = new AWS.Kinesis();
export function receiveEvent(event, context, callback) {
console.log('demoHandler');
console.log(`Event: ${JSON.stringify(event, null, 2)}`);
console.log(`Context: ${JSON.stringify(context, null, 2)}`);
const base64Data = event.Records[0].kinesis.data;
@justinsoliz
justinsoliz / cloud-config.yml
Last active January 19, 2020 15:18
Terraform definition for Jenkins with ECS, EFS, CoreOS
#cloud-config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
coreos:
units:
- name: update-engine.service
@justinsoliz
justinsoliz / resources.tf
Created August 30, 2016 15:26
Terraform S3 to Lambda notification
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_iam_role" "iam_for_terraform_lambda" {
name = "app_${var.app_env}_lambda"
assume_role_policy = <<EOF
{
@justinsoliz
justinsoliz / package.json
Created November 15, 2015 01:04 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@justinsoliz
justinsoliz / macbook-setup.md
Created November 12, 2015 00:35 — forked from antiagainst/macbook-setup.md
Set Up Zsh, Presto, Homebrew, Ruby, Powerline, and Vim on Mac OS X

blog about these tools

Setup Zsh and Prezto

  • Change default shell to Zsh
chsh -s $(which zsh)
  • Clone Presto and install it according to README.md
@justinsoliz
justinsoliz / installing_cassandra.md
Last active August 29, 2015 14:28 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Best Berry Cobbler

  • Topping

    • 1 1/2 cups all-purpose flour
    • 1/2 cup firmly packed light brown sugar
    • 1 1/2 teaspoons double-acting baking powder
    • 3/4 teaspoon salt
    • 1 tablespoon cinnamon
  • 1 tsp cardamom

@justinsoliz
justinsoliz / kafka-ws.md
Last active August 29, 2015 14:23 — forked from pk11/kafka-ws.md

WebSockets - The good parts

  • if you want a non-blocking persistent TCP connection, this is your only choice
  • WebSocket protocol matured over time. Excellent tooling support:
  • chrome dev
  • versatile client and server libraries on all major platforms
  • good browser support

WebSockets - Gotchas

http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;