Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrei Rusu beatfactor

View GitHub Profile
@beatfactor
beatfactor / 01 – Running serialport in Docker with node alpine.md
Last active Dec 7, 2020
Running serialport in Docker with node alpine
View 01 – Running serialport in Docker with node alpine.md

When attempting to build the awesome serialport NPM package in Docker using a node alpine image, in usually failes on building the node-gyp package.

There are various workarounds which can be found online, such as this one.

However, the key ingredient is building the serialport package from source, using this line:

npm install serialport --build-from-source=serialport
@beatfactor
beatfactor / install_nginx_macos_source.md
Last active Jan 17, 2022
Install Nginx on Mac OS from source (without brew)
View install_nginx_macos_source.md

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@beatfactor
beatfactor / nw_api_wish.md
Created Aug 31, 2017 — forked from senocular/nw_api_wish.md
Nightwatch API Wishlist
View nw_api_wish.md
  • all callbacks use result object
  • custom commands, page object/section commands have same behavior/interface
  • client/api property consistency
  • better separation of user-defined apis and internal properties (page objects etc)
  • page/section objects have full api surface
  • Page objects, commands classes, having proper instanceof-checkable instances (no weird F() constructor)
  • Support command overrides rather than throwing an error
  • no legacy stuff
    • afterEach hook can receive the browser object only in its async form
  • async behavior consistency/clarity
View elementEmpty.js
exports.assertion = function(selector) {
this.selector = selector;
this.message = 'Testing if element <' + selector + '> has no descendents.';
this.expected = true;
this.pass = function(value) {
return value && (value.length === 0);
};
this.value = function(result) {
View globals.js
module.exports = {
groupGlobals : null,
checkGroupGlobals : function(hookName) {
if (hookName && this.groupGlobals) {
return this.groupGlobals[hookName];
}
if (this.test_settings.group_name) {
try {
View chromedriver.js
var chromedriver = require('chromedriver');
var moduleFolder = '../../node_modules/chromedriver/lib/chromedriver/';
var path = require('path');
var binPath = path.resolve(path.join(moduleFolder, process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver'));
module.exports = {
defaultInstance : null,
start : function() {
this.defaultInstance = require('child_process').execFile(binPath, [