by Angel Leon. March 17, 2015;
Last update on December 14, 2023
Updated on February 27, 2023
Updated August 29, 2019.
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] |
#!/bin/sh | |
# Combined all static libaries in the current directory into a single static library | |
# It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top | |
# The script takes a single argument, which is the name of the final, combined library to be created. | |
# | |
# For example: | |
# => combine_static_libraries.sh combined-library | |
# | |
# Script by Evan Schoenberg, Regular Rate and Rhythm Software |
#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. |
It is not usually recommended to reuse errors since the stack trace is attached whenever the error is instantiated.
However in some cases the overhead of doing that may affect performance, especially if the error is an exception that is known to occur frequently and is handled.
Only in these cases it may be advantagous to reuse the created Error
. In all other cases getting a full stacktrace created at the time the exception occurs is to be preferred as it gives much better information needed to debug the problem.
➝ node errors.js
This is specifically tailored to Node.js binding projects in which case the C++ layer is always a library.
Clone gyp:
git clone --depth 1 https://chromium.googlesource.com/external/gyp.git gyp
Add the below common.gypi
file in the root of the project.
/* test load from stream | |
* | |
* compile with: | |
* | |
* gcc -g -Wall load-from-stream.c `pkg-config vips --cflags --libs` | |
* | |
* test with: | |
* | |
* cat k2.jpg k4.jpg | ./a.out | |
*/ |
package main | |
//#include<stdio.h> | |
//void inC() { | |
// printf("I am in C code now!\n"); | |
//} | |
import "C" | |
import "fmt" | |
func main() { |
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.