This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| #include "v8.h" | |
| #include "helpers.h" | |
| #include <iostream> | |
| using v8::Local; | |
| using v8::String; | |
| using v8::Array; | |
| void PrintLocalString(v8::Local<v8::String> key){ |
| #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. |
| ... | |
| "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, |
| { | |
| 'targets': [ | |
| { | |
| 'target_name': 'bcrypt_napi', | |
| 'sources': [ | |
| 'src/blowfish.cc', | |
| 'src/bcrypt.cc', | |
| 'src/bcrypt_node.cc' | |
| ], | |
| 'cflags!': [ '-fno-exceptions' ], |
| 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; | |
| }; |
| 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]; |
| '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) { |
| for i in `ls *.svg` | |
| rsvg-convert -f pdf -o PDF/${i}.pdf $i |
A quick overview of the node.js streams interface with basic examples.
This is based on @brycebaril's presentation, Node.js Streams2 Demystified
Streams are a first-class construct in Node.js for handling data.
Think of them as as lazy evaluation applied to data.