Skip to content

Instantly share code, notes, and snippets.

View Siyfion's full-sized avatar

Simon Mansfield Siyfion

View GitHub Profile
@tellnes
tellnes / index.js
Created June 14, 2012 13:15
SVG Rasterizer service for Node.js
var connect = require('connect')
, exec = require('child_process').exec
, fs = require('fs')
, path = require('path')
, seaport = require('seaport')
// Detect tmp dir
var TMP_DIR = (function() {
var dirs = [process.env.TMP, '/tmp', process.cwd()]
@desandro
desandro / require-js-discussion.md
Created January 31, 2013 20:26
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.


We keep all our Terraform files under the terraform directory.

Terraform allows to reuse definitions across environments. We thus don't have to have a set of definitions for provisioning Onadata resources in the production environment and a different set of definitions for provisioning Onadata resources in the staging environment. How we go about this is by creating a shared Terraform module for our setup, then including this module in Terraform files corresponding to each of the environments we plan to deploy the setup.

The following subsections will take you through how to codify your setup using Terraform, the Ona way. As a reference, we will use Onadata's Terraform files:

1. Create a Reusable Module

Keep the Terraform resource blocks for your setup in ../terraform/modules/. For instance, the Onadata setup's resource blocks are kept in terraform/modules/onadata. Then isolate the Ter