Skip to content

Instantly share code, notes, and snippets.

View luisleao's full-sized avatar

Luís Leão luisleao

View GitHub Profile
@stonehippo
stonehippo / nodejs_raspberry_pi.md
Last active October 14, 2025 19:48
Methods for installing Node.js on Raspberry Pi

Setting Up Node.js On Raspberry Pi

There are several ways that you can set up Node.js on a Raspberry Pi when running Raspbian/Rapberry Pi OS. Depending on your needs, the version of the RPi that you're using, and how you like to manage installs, you have a lot of options.

A brief aside: alternative runtimes

Node.js was an early entrant to the Javascript runtime and I think it's still the most widely used. But it's not the only runtime out there these days. Some of the alternatives might be better choices for your Raspberry Pi setup.

The two other Javascript runtimes I've used are deno and bun. Both are newer than Node.js and have incorporated a modern features nicely, like built-in support for Typescript. They also have a more compact install, since they bundle everything into a single CLI executable.

@sabas1080
sabas1080 / ESP32_HID.ino
Last active November 25, 2024 08:30
Example of HID Keyboard BLE with ESP32
/*
Copyright (c) 2014-2020 Electronic Cats SAPI de CV. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@aallan
aallan / retro_phone.py
Last active June 4, 2020 16:59
A Python script managing a Google Voice Assistant living inside a rotary dial phone. Full write up at https://medium.com/@aallan/a-retro-rotary-phone-powered-by-aiy-projects-and-the-raspberry-pi-e516b3ff1528.
#!/usr/bin/env python3
#
# Full write up at https://medium.com/@aallan/a-retro-rotary-phone-powered-by-aiy-projects-and-the-raspberry-pi-e516b3ff1528.
import logging
import sys
import threading
import RPi.GPIO as GPIO
import pygame
@codediodeio
codediodeio / index.js
Created September 13, 2017 00:21
Integrate Twilio with Firebase Cloud Functions
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
const twilio = require('twilio');
const accountSid = functions.config().twilio.sid
const authToken = functions.config().twilio.token
const client = new twilio(accountSid, authToken);
@drulabs
drulabs / FCM_message_single_device_curl_command.txt
Last active June 14, 2023 15:27
Curl command for sending FCM message
curl -i -H 'Content-type: application/json' -H 'Authorization: key=<your_server_key>' -XPOST https://fcm.googleapis.com/fcm/send -d '{
"registration_ids":["registration_ids", "of the", "target", "devices as array"],
"notification": {
"title":"Title of your notification",
"body":"content of your notification"
},
"data": {
"key1" : "value1",
"key2" : "value2",
"key3" : 23.56565,
var five = require('johnny-five');
var http = require('http');
var Router = require('node-simple-router');
var router = Router();
var board = new five.Board();
var server = http.createServer(router);
server.listen(3000);
@jsonfry
jsonfry / Remote ADB.md
Last active September 8, 2023 19:45
Connect to adb over a network. Useful for running jenkins in 'the cloud', but testing on real devices locally.

Connect your devices to a pi that has been configured like below.

Pi Setup

Download raspbian etc, go through normal setup.

Setup networking

This will let you find your pi locally using it's name, e.g. ping davepi.local

sudo apt-get update

sudo apt-get install avahi-daemon

@tagliati
tagliati / marcha_imperial
Created February 11, 2012 20:42
Marcha imperial para arduino
int ledPin = 13;
//led for visualization (use 13 for built-in led)
int speakerPin = 11;
//speaker connected to one of the PWM ports
#define c 261
#define d 294
#define e 329
#define f 349
@zenorocha
zenorocha / hub.me.pt.md
Created November 22, 2011 11:30
...ou a história do meu amigo Clark Kent

hub.me ...ou a história do meu amigo Clark Kent

image

Eu amo o Github, sério, eu amo mesmo. E não sou só eu, meu amigo super desenvolvedor Clark Kent ama também.

Algumas semanas atrás, ele decidiu criar um novo projeto no Github chamado Krypton.

Esse projeto era incrível e à medida que o tempo passava mais e mais pessoas começaram a acompanhar e forkar o projeto. Irado!

@thiagoalz
thiagoalz / SK8Led.pde
Created August 31, 2011 19:11
Código inicial do SK8Led do Tony :)
/*
SK8Led
*/
//pins
int pins[] = {2,3,4};
//{red, green, blue}
int configPins[] = {8,9,11,12};
//{varUpPin, varDownPin, valueUpPin, valueDownPin}