npm install cordova
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
replacements=( | |
"NanAsyncWorker/Nan::AsyncWorker" | |
"NanAsyncQueueWorker/Nan::AsyncQueueWorker" | |
"NanCallback/Nan::Callback" | |
"NanSetInternalFieldPointer/Nan::SetInternalFieldPointer" | |
"NanGetInternalFieldPointer/Nan::GetInternalFieldPointer" | |
"NanNewBufferHandle\\(([^;]+);/Nan::NewBuffer(\\1.ToLocalChecked();" | |
"(NanNew(<(v8::)?String>)?\\(\"[^\"]*\"\\))/\\1.ToLocalChecked()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: python -*- | |
{ | |
"targets": [ | |
{ | |
"include_dirs": ["<!(node -e \"require('nan')\")"], | |
"target_name": "NanObjectWrap", | |
"sources": [ | |
"nan-objectwrap.cc" | |
], | |
"conditions": [ |
- Proposal: TBD
- Author: Evan Maloney
- Status: Draft
- Review manager: TBD
Frequently, closures are used as completion callbacks for asynchronous operations, such as when dealing with network requests. It is quite common to model these sorts of operations in such a way that an object instance represents a request/response transaction, for example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enableextensions | |
chcp 65001 | |
set input=%1 | |
set device=%2 | |
set loglevel=quiet | |
for %%i in ("%~f1") do set dirname=%%~dpi | |
for %%i in ("%~f1") do set extension=%%~xi | |
set tempfile=%dirname%%RANDOM%-temp.m4a |
Neither JOSE users nor JOSE library designers should be required to understand cryptography primitives. At a lower level, this can lead to badly implemented primitives. On a higher level, this can lead to reasoning by lego.
#Headless Setup of Raspberry Pi Zero W (Raspberry Pi 3 Wireless) (macOS)
- Formatt the Micro SD card - Open a terminal and type 'diskutil list'. Find your card and copy the disk name (For example: /dev/disk4). Format the card with
diskutil eraseDisk ExFat temp disk4(Use your disk here)
- Download Raspbian -
wget https://downloads.raspberrypi.org/raspbian_lite_latest
- Unmount the SD card -
diskutil unmountDisk /dev/disk4
or whatever your disk path is - Mount the Raspbian image to the card -
sudo dd if=PATH-TO-RASPBIAN-IMAGE
of=/dev/disk4` or whatever your disk path is - Enable SSH on the Pi -
cd /volumes && ls
. You should see a boot partition from the SD cardcd boot && touch ssh
- Setup WiFi on the PI - While still in the boot partition of the card type
nano wpa_supplicant.conf
and enternetwork={ ssid="YOUR-SSID" psk="YOUR-WIFI-PASSWORD" }
- Boot the PI - Unmount the card
diskutil unmountDisk /dev/disk4
(or whatever your disk path is) and put it in the