Skip to content

Instantly share code, notes, and snippets.

View ginixsan's full-sized avatar

Ginés Sanz ginixsan

View GitHub Profile
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active November 15, 2024 17:37
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@JoostKiens
JoostKiens / iBeaconCalculateDistance.js
Last active October 26, 2022 17:40
iBeacon calculate distance in meters
// Based on http://stackoverflow.com/a/20434019
function calculateAccuracy(txPower, rssi) {
if (rssi === 0) {
return -1; // if we cannot determine accuracy, return -1.
}
var ratio = rssi * 1 / txPower;
if (ratio < 1.0) {
return Math.pow(ratio, 10);