Skip to content

Instantly share code, notes, and snippets.

View NickNaso's full-sized avatar
🎯
Focusing

Nicola Del Gobbo NickNaso

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am NickNaso on github.
  • I am nicknaso (https://keybase.io/nicknaso) on keybase.
  • I have a public key whose fingerprint is E4C8 FE7F 27F4 F780 4334 7978 39E9 BBA6 417F A66E

To claim this, I am signing this object:

@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 / server.js
Created November 12, 2016 18:18
Dinamically attach routes to express app
'use strict'
const express = require('express')
const http = require('http')
const app = express()
function handleGet (req, res) {
res.send('/GET handler')
}
@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 / redirect.js
Created January 18, 2017 20:55
ExpressJS relative redirect For more info take alook here: http://expressjs.com/en/4x/api.html#res.redirect
'use strict'
const express = require('express')
const http = require('http')
const app = express()
////////////////////////////////// ROUTER /////////////////////////////////////
const router = express.Router()
@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 / 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 / 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 / package.json
Last active December 24, 2017 22:21
bcrypt-napi package.json
...
"scripts": {
"test": "npm install --build-from-source && nodeunit test",
"install": "node-gyp rebuild"
},
"dependencies": {
"bindings": "1.3.0",
"node-addon-api": "1.1.0"
},
"gypfile": true,