Skip to content

Instantly share code, notes, and snippets.

View nebrius's full-sized avatar

Bryan Hughes nebrius

View GitHub Profile
@nebrius
nebrius / typescript-setup.md
Last active May 13, 2023 01:07
Instructions for configuring TypeScript for Node.js

This gist will walk you through configuring your Node.js Project so that you can write your code in TypeScript using Visual Studio Code. These isntructions were written for attendees at Microsoft Build doing a super secret thing I can't talk about (ooo, the suspense!), but they also will work for any Node.js project written in TypeScript.

Before we get started configuring TypeScript, we need to initialize a new Node.js project. If you have not already installed Node.js, please head over to nodejs.org and install the latest LTS version of Node.js. Once this is done, create a folder for your Node.js project and open a terminal in this folder. In the terminal, run the command:

npm init

This command will ask you a series of questions. You can use the defaults for each question here because they don't really matter. These only matter if you intend to publish your module to [npmjs.com](htt

@nebrius
nebrius / ibm-index-node-rpi.md
Last active February 22, 2018 22:12
Node.js + Raspberry Pi = Love IBM Index Talk Notes

Hardware list:

  • Ethernet cable
  • Thunderbolt ethernet adapter
  • USB power adapter
  • MiFi USB cable inverter for powering RPi
  • 2 x Micro USB B cables
  • 2 x Micro SD Cards
  • 2 x SD Card adapters
  • 2 x Raspberry Pi (2s)
{
"a": {
"name": "a",
"loadDependencies": [
"b"
],
"lazyDependencies": [
"c"
]
},
Escalation policy Draft
Reporting process:
1. Person files formal complaint to TSC or CommComm ("governing body" from here on out)
1.1 Uses Zendesk so submitters can track status of the complaint
1.2 Can choose which governing body to submit to in the form
1.3 Person includes their email, which the governing body will use to notify them of the decision
1.4 Shared credentials among a few people: governing body chairs, governing body board director(s), and the Foundation board chair (?)
1.5 Still unclear exactly who brings complaint to governing body, but most likely will be the chair or governing body board director(s) so they can exclude members who the complaint is against (if any) before complaint is emailed (?) to all governing body members.
@nebrius
nebrius / 2017_board_vote.md
Last active January 30, 2017 02:05
2017 Node.js Foundation Individual Membership Director Vote

Hello Node.js folks! I want to remind you all that voting for the Individual Membership Director closes soon at January 30th, 17:00 UTC (see this in your timezone). This is a really important vote, as the decisions that the Node.js Foundation Board affects the Node.js Project, and indeed the entire Node.js community. I urge you to take a look at the candidates and the Q&A for each, and vote for who you think will be the most effective at helping support the Node.js project!

Instructions for voting: nodejs/board#42

Q&A with William Kapke: nodejs/board#43

Q&A with Kat Marchán: nodejs/board#44

Q&A with Charlie Robbins: nodejs/board#45

'use strict';
const five = require('johnny-five');
const board = new five.Board();
const hsv = require('hsv2rgb');
board.on('ready', () => {
const led = new five.Led.RGB({
pins: {
red: 9,
@nebrius
nebrius / gist:a57c0ea52236943b3793
Created November 25, 2015 23:24
nodebots-interchange, Raspbian Jesse, node 4.2.1 armv7 error
make: Entering directory '/home/pi/nodebots-hcsr04/node_modules/nodebots-interchange/node_modules/serialport/build'
make: *** No rule to make target '../.node-gyp/4.1.2/include/node/common.gypi', needed by 'Makefile'. Stop.
make: Leaving directory '/home/pi/nodebots-hcsr04/node_modules/nodebots-interchange/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.1.7-v7+
@nebrius
nebrius / gist:e08bac93b17a4bbcc97d
Last active October 15, 2015 18:39
Output of `npm install git://github.com/jgautier/firmata.git` (updated)
-
> firmata@0.7.1-pre-2 postinstall /Users/bhughes/Downloads/temp/node_modules/firmata
> node scripts/postinstall
> serialport@2.0.1 install /Users/bhughes/Downloads/temp/node_modules/firmata/node_modules/serialport
> node-pre-gyp install --fallback-to-build
CXX(target) Release/obj.target/serialport/src/serialport.o
@nebrius
nebrius / gist:e5e443bd408cefcf5a35
Created October 15, 2015 18:21
Output of `npm install serialport@latest` in Node 4.2.0
-
> serialport@2.0.1 install /Users/bhughes/Downloads/temp/node_modules/serialport
> node-pre-gyp install --fallback-to-build
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
../src/serialport_unix.cpp:695:20: warning: comparison of array 'device.locationId' not equal to a null pointer is always true [-Wtautological-pointer-compare]
if (device.locationId != NULL) {
~~~~~~~^~~~~~~~~~ ~~~~
@nebrius
nebrius / gist:b6323f0be26598266188
Last active August 29, 2015 14:22
Heya interface proposal
var heya = require('./lib/index.js');
var controller = new heya.WebKeyboard();
var bot = new heya.PawelBot({
leftServo: 'A0',
rightServo: 'A1'
});
/*