Skip to content

Instantly share code, notes, and snippets.

View NickNaso's full-sized avatar
🎯
Focusing

Nicola Del Gobbo NickNaso

🎯
Focusing
View GitHub Profile
@NickNaso
NickNaso / enable_mongo.sh
Created March 21, 2016 21:35 — forked from sgnn7/enable_mongo.sh
Mongodb 3.2 on Ubuntu 15.10
echo '[Unit]
Description=High-performance, schema-free document-oriented database
After=syslog.target network.target
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod -f /etc/mongod.conf
[Install]
@NickNaso
NickNaso / API.md
Last active December 14, 2017 23:58 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@NickNaso
NickNaso / nginx.conf
Created December 23, 2016 09:13 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@NickNaso
NickNaso / app.js
Created July 5, 2017 22:12 — forked from adrai/app.js
aws-serverless-fastify
const fastify = require('fastify')();
fastify.get('/', (request, reply) => reply.send({ hello: 'world' }));
if (require.main === module) {
// called directly i.e. "node app"
fastify.listen(3000, (err) => {
if (err) console.error(err);
console.log(`server listening on ${fastify.server.address().port}`);
});
@NickNaso
NickNaso / after_res_hooks.js
Created July 20, 2017 01:17 — forked from pasupulaphani/after_res_hooks.js
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
@NickNaso
NickNaso / GIF-Screencast-OSX.md
Created August 18, 2017 10:13 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@NickNaso
NickNaso / helpers.cc
Created September 6, 2017 22:27 — forked from AnnaMag/helpers.cc
Helper functions for printing V8 Local-wrapped objects
#include "v8.h"
#include "helpers.h"
#include <iostream>
using v8::Local;
using v8::String;
using v8::Array;
void PrintLocalString(v8::Local<v8::String> key){
@NickNaso
NickNaso / nginx.conf.default
Created October 5, 2017 04:44 — forked from nishantmodak/nginx.conf.default
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@NickNaso
NickNaso / svg-to-vector-pdf.sh
Created January 6, 2018 13:48 — forked from tpitale/svg-to-vector-pdf.sh
Loop to rsvg-convert all SVG files to Vector PDF
for i in `ls *.svg`
rsvg-convert -f pdf -o PDF/${i}.pdf $i
@NickNaso
NickNaso / README.md
Created January 9, 2018 23:26 — forked from joyrexus/README.md
Node.js streams demystified

A quick overview of the node.js streams interface with basic examples.

This is based on @brycebaril's presentation, Node.js Streams2 Demystified

Overview

Streams are a first-class construct in Node.js for handling data.

Think of them as as lazy evaluation applied to data.