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 / 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 / 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,
@NickNaso
NickNaso / binding.gyp
Created December 24, 2017 22:22
bcrypt-napi binding.gyp
{
'targets': [
{
'target_name': 'bcrypt_napi',
'sources': [
'src/blowfish.cc',
'src/bcrypt.cc',
'src/bcrypt_node.cc'
],
'cflags!': [ '-fno-exceptions' ],
@NickNaso
NickNaso / bcrypt_node.cc
Created December 24, 2017 22:35
bcrypt-napi init
Napi::Object init(Napi::Env env, Napi::Object exports) {
exports.Set(Napi::String::New(env, "gen_salt_sync"), Napi::Function::New(env, GenerateSaltSync));
exports.Set(Napi::String::New(env, "encrypt_sync"), Napi::Function::New(env, EncryptSync));
exports.Set(Napi::String::New(env, "compare_sync"), Napi::Function::New(env, CompareSync));
exports.Set(Napi::String::New(env, "get_rounds"), Napi::Function::New(env, GetRounds));
exports.Set(Napi::String::New(env, "gen_salt"), Napi::Function::New(env, GenerateSalt));
exports.Set(Napi::String::New(env, "encrypt"), Napi::Function::New(env, Encrypt));
exports.Set(Napi::String::New(env, "compare"), Napi::Function::New(env, Compare));
return exports;
};
@NickNaso
NickNaso / bcrypt_node.cc
Created December 24, 2017 22:48
bcrypt-napi
class SaltAsyncWorker : public Napi::AsyncWorker {
public:
SaltAsyncWorker(Napi::Function& callback, std::string seed, ssize_t rounds)
: Napi::AsyncWorker(callback), seed(seed), rounds(rounds) {
}
~SaltAsyncWorker() {}
void Execute() {
char salt[_SALT_LEN];
@NickNaso
NickNaso / hertzy.js
Created January 3, 2018 21:42
Hertzy example
'use strict'
const const Hertzy = require('hertzy')
// Obtain or create new frequency, a channel where you can emit or listen for an
// event issued by other modules
const usr = Hertzy.tune('user')
// Listen for event 'user:add'
usr.on('user:add', function (data) {
@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.