Skip to content

Instantly share code, notes, and snippets.

@darahayes
darahayes / node.md
Last active January 26, 2016 11:55
Getting started with node

#Getting Started With Node

So... Enterprise development is a little crazy. I think he managed to give us a bare idea of what we're meant to do but he left out some really important things. So this is a post for people who might not be familiar with Node.js etc.

Firstly, it can be a bit of a pain to install properly. Luckily there's a great project called nvm (node version manager) that can make the installation and management of node versions on *nix really easy. nvm can be installed in a single line. Follow the instructions to install in the link.

Once installed you can install node and npm with the following

nvm install 4.2.3 #install node
nvm use 4.2.3 #tell nvm to place the installation in the right directories
@darahayes
darahayes / appspec.yml
Created March 24, 2017 14:42 — forked from moshest/appspec.yml
Node.js Project on AWS CodeDeploy CentOS
version: 0.0
os: linux
files:
- source: /
destination: /home/ec2-user/node
permissions:
- object: /home/ec2-user
owner: ec2-user
group: ec2-user
type:
@darahayes
darahayes / ansible_kms_encrypt_decrypt.md
Last active February 18, 2024 18:57
KMS Encrypt and Decrypt filters in Ansible

KMS Encrypt and Decrypt Filters for Ansible

This Gist shows how you can encrypt/decrypt variables with KMS during your Ansible playbook execution. While google searching I couldn't find anything useful on the subject.

Let's say your project has a folder of playbooks called plays.

In that folder, create a folder called filter_plugins and insert kms_filters.py (included in this gist)

const http = require('http');
const memwatch = require('memwatch-next');
const heapdump = require('heapdump');
var server = http.createServer((req, res) => {
for (var i=0; i<1000; i++) {
server.on('request', function leakyfunc() {});
}
res.end('Hello World\n');
const Hapi = require('hapi')
const Joi = require('joi')
const Boom = require('boom')
const server = new Hapi.Server()
server.connection({ host: 'localhost', port: 8000 })
server.register(
[
{
@darahayes
darahayes / hapi-swagger-next-example.js
Last active August 8, 2017 11:15
Sample usage of the hapi-swagger-next module. A fork of hapi-swagger that serves the latest Swagger UI. Featured in my article https://darahayes.com/get-latest-swagger-ui-hapi-swagger-next/
const Hapi = require('hapi')
const Joi = require('joi')
const Boom = require('boom')
const server = new Hapi.Server()
server.connection({ host: 'localhost', port: 8000 })
server.register(
[
{
@darahayes
darahayes / list
Created October 9, 2017 08:07 — forked from mikemfleming/list
what i learned from node interactive 2017
*********************************************
SLIDES ARE AVAILABLE ONLINE ... MOSTLY
'http://events.linuxfoundation.org/events/node-interactive/program/agenda'
*********************************************
// there is a node certification coming
'https://nodejs.org/en/foundation/education/'
// interesting talks
- 'taking your server to ludicrous speed': 'http://sched.co/AtiP'
apiVersion: v1
data:
broker-config: |
registry:
- type: "dockerhub"
name: "dh"
url: "https://registry.hub.docker.com"
org: "aerogearcatalog"
tag: "latest"
white_list:

Commit Message Guidelines

This project has rules for commit messages (based on Conventional Commits). There are several reasons for this:

  • Commit messages are more readable, especially when looking through the project history.
  • Commit messages describe whether a major, minor or patch change has been introduced (see semver.org)
  • Commit messages can be used to generate a changelog.

Commit Message Format

Each commit message consists of a header, an optional body and an an optional footer. The header has a special

const knex = require('knex')
const db = knex({
client: 'pg',
connection: {
'user': 'postgresql',
'password': 'postgres',
'database': 'memeolist_db',
'host': '127.0.0.1',
'port': '15432'