Skip to content

Instantly share code, notes, and snippets.

# We only have one backend to define: NGINX
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# Only allow purging from specific IPs
acl purge {
"localhost";
"127.0.0.1";
// Requires https://www.npmjs.org/package/s3-policy and https://www.npmjs.org/package/node-uuid
var config = require('env/' + process.env.NODE_ENV),
policy = require('s3-policy'),
uuid = require('node-uuid');
// SETUP S3
const AWS_ACCESS_KEY = config.s3.accessKey;
const AWS_SECRET_KEY = config.s3.secret;
const S3_BUCKET = config.s3.bucket;
#!/bin/sh
#
# Orinally made by Lovell Fuller for sharp
# https://github.com/lovell/sharp
#
# Usage:
# curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash -
#
@risul
risul / configuration.yml
Created February 23, 2016 10:15 — forked from fightingtheboss/configuration.yml
An Amazon Elastic Beanstalk configuration file for a Meteor project. This file needs to be saved in the .ebconfiguration/ directory at the root of your project. Deployed with `git aws.push`. Replace MONGO_URL with the URL to your MongoDB instance (I use MongoHQ).
packages:
yum:
git: []
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh:
mode: "000755"
user: root
group: root
encoding: plain
@risul
risul / .dockercfg.template
Created February 23, 2016 10:17 — forked from skwasha/.dockercfg.template
Deploying Meteor to AWS Elastic Beanstalk as a Docker image from Github via CircleCI
{
"https://index.docker.io/v1/": {
"auth": "<base64 encoded Docker username:password>",
"email": "<Docker Account Email>"
}
}
@risul
risul / deploy_beanstalk.sh
Created February 23, 2016 19:02 — forked from oriolgual/deploy_beanstalk.sh
Deploy to Beanstalk script taken from Codeship
# Copied from http://www.codeship.io/documentation/continuous-deployment/deployment-to-elastic-beanstalk/
#!/bin/sh
export APP_VERSION=`git rev-parse --short HEAD`
pip install awscli
# clean build artifacts and create the application archive (also ignore any files named .git* in any folder)
git clean -fd
# precompile assets, ...
@risul
risul / app.config
Created February 23, 2016 22:25 — forked from krishamoud/app.config
Deploy Meteor onto Elastic Beanstalk
option_settings:
- option_name: AWS_SECRET_KEY
value: -------------------------------------------
- option_name: AWS_ACCESS_KEY_ID
value: ------------------------------
- option_name: PORT
value: 8081
@risul
risul / deploy.sh
Created February 27, 2016 11:11 — forked from felipesere/deploy.sh
Deploying form Circle-CI to AWS- ECS
#!/bin/bash
aws --version
aws configure set default.region us-west-2
aws configure set default.output json
echo "preparing task definition"
aws ecs describe-task-definition --task-definition applications | ./jq --arg x $CIRCLE_SHA1 ' .taskDefinition
| del(.status)
| del(.taskDefinitionArn)
@risul
risul / meteor-async.md
Created April 1, 2016 00:50 — forked from joscha/meteor-async.md
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished.

@risul
risul / n-to-m.js
Created May 18, 2017 01:17 — forked from moret/n-to-m.js
N to M GraphQL Sequelize Question
import _ from 'underscore';
import Promise from 'bluebird';
import {
GraphQLInt,
GraphQLList,
GraphQLObjectType,
GraphQLSchema,
GraphQLString
} from 'graphql';
import {