Skip to content

Instantly share code, notes, and snippets.

View nazar's full-sized avatar

Nazar Aziz nazar

  • Clevertech
  • Newlyn, Cornwall, United Kingdom
View GitHub Profile
@smnh
smnh / flattenData.js
Last active December 25, 2023 07:52
Function for flattening data before indexing it to Elasticsearch (http://smnh.me/indexing-and-searching-arbitrary-json-data-using-elasticsearch)
const _ = require('lodash');
module.exports = {
flattenData
};
/**
* This function flattens objects by converting them into a flat array of objects having four fields:
* - "key": the path of the field in the original object
* - "type": the type of the field value
@jhovell
jhovell / EcsBurstBalance.json
Created February 1, 2017 21:52
ECS BurstBalance monitoring, alerting and healthcheck
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Alerts on ECS burst balance and terminates unhealthy hosts",
"Parameters" : {
"ClusterName": {
"Type": "String",
"Description": "ECS Cluster name"
},
@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@ivanvanderbyl
ivanvanderbyl / gist:4222308
Created December 6, 2012 06:55
Postgres 9.1 to 9.2 upgrade guide for Ubuntu 12.04
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"