Skip to content

Instantly share code, notes, and snippets.

View aaronroberson's full-sized avatar

Aaron Roberson aaronroberson

View GitHub Profile
http {
proxy_cache_path /tmp/nginx/cache
levels=1:2
keys_zone=main:10m
max_size=1g inactive=1d;
proxy_temp_path /tmp/nginx/tmp;
server {
listen 80;
server_name app.example.com;
@aaronroberson
aaronroberson / cart-controller.js
Last active May 27, 2016 01:15
Geekwise Day 8 Assets
(function(angular) {
var app = angular.module('MyStore');
// Inject in the CartService
app.controller('CartController', function($scope) {
// Set the items on the scope to the items in the CartService
$scope.items;
@aaronroberson
aaronroberson / flatten-nested-array.js
Last active September 23, 2017 00:43
flattens a nested array of integers at any depth
/**
* flattenNested - Reduces an array of arbitrarily nested arrays of integers into a flat array of integers.
* @param value {Array} - The array to flatten.
* @param iterator {Array} - An array used for initializing or for iteration during recursion.
* @returns {Array} - The flattened array, yay!
*/
function flattenNested(value, iterator = []) {
// Add exit case straight away to help prevent stack overflow
if (!value) return iterator;