Skip to content

Instantly share code, notes, and snippets.

View nicka's full-sized avatar
Serverlessing

Nick den Engelsman nicka

Serverlessing
View GitHub Profile
@danamajid
danamajid / nosql-done-right-with-dynamodb.js
Created March 12, 2019 17:28
NoSQL Design for DynamoDB
// See: https://www.youtube.com/watch?v=HaEPXoXVf2k
const AWS = require('aws-sdk');
AWS.config.update({region: 'us-east-1'});
const dynamoDb = new AWS.DynamoDB.DocumentClient({ api_version: '2012-08-10' });
const TABLE = 'single-table-design';
const GSI1 = 'gsi1';
const GSI1PK = `${GSI1}pk`;
const GSI1SK = `${GSI1}sk`;
@adrianhall
adrianhall / AppSync-Example.yaml
Created April 13, 2018 16:01
An example CloudFormation template for AWS AppSync
---
Description: AWSAppSync DynamoDB Example
Resources:
GraphQLApi:
Type: "AWS::AppSync::GraphQLApi"
Properties:
Name: AWSAppSync DynamoDB Example
AuthenticationType: AWS_IAM
PostDynamoDBTableDataSource:
#!/bin/sh
# Install Homebrew
which brew > /dev/null 2>&1
if [ $? -eq 1 ]; then
#Cheat, if we don't have brew, install xcode command line utils too
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
@singledigit
singledigit / cognito.yaml
Last active April 28, 2024 15:12
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@BretFisher
BretFisher / .travis.yml
Created February 15, 2016 21:26
Travis-CI Docker Image Build and Push to AWS ECR
sudo: required #is required to use docker service in travis
language: php #can be any language, just php for example
services:
- docker # required, but travis uses older version of docker :(
install:
- echo "install nothing!" # put your normal pre-testing installs here
@derekstavis
derekstavis / LICENSE.md
Last active February 23, 2017 20:07
Integrate Github Pull Requests into Travis by overriding environment

The MIT License (MIT)

Copyright (c) 2015 Derek Willian Stavis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@viezel
viezel / build-module-android.sh
Last active August 29, 2015 14:01
Build and copy android module
##
## Build an Appcelerator Android Module
## Then copy it to the default module directory
##
## (c) Napp ApS
## Mads Møller
##
## HOW TO GUIDE
@ibejohn818
ibejohn818 / gist:10954133
Last active February 20, 2019 21:16
Compile FFMpeg & Dependencies - RedHat Linux
# run as root!
yum erase ffmpeg faac libfaac x264 libx264 libvpx -y
yum install gcc gcc-c++ automake autoconf libtool nasm git subversion nasm pkgconfig -y
export LD_LIBRARY_PATH=/usr/local/lib/
echo /usr/local/lib > /etc/ld.so.conf.d/custom-libs.conf
ldconfig
@felipeelias
felipeelias / spec_helper.rb
Last active December 10, 2015 17:48
Simple 'database cleaner' approach using `config.around`. Was able to cut down some seconds out of the suite. Thanks to @brandonhilkert
RSpec.configure do |config|
config.around do |example|
# For examples using capybara-webkit for example.
# Remove this if you don't use it or anything similar
if example.metadata[:js]
example.run
ActiveRecord::Base.connection.execute("TRUNCATE #{ActiveRecord::Base.connection.tables.join(',')} RESTART IDENTITY")
else
ActiveRecord::Base.transaction do
@goosetav
goosetav / howto.md
Created November 1, 2012 21:01
prevent ttf fonts while running poltergeist

RE: teampoltergeist/poltergeist#44

Use Rack::SimpleEndpoint to prevent Poltergeist/PhantomJS from crashing on TTF fonts.

In config/environments/test.rb, add

require 'rack/contrib/simple_endpoint'
config.middleware.insert_after Rack::Runtime, Rack::SimpleEndpoint, /\.ttf$/ do |req, res, match|
  res.status = '403'

"I will not serve TTF fonts in test mode."