Skip to content

Instantly share code, notes, and snippets.

View jimf99's full-sized avatar

JimFyyc jimf99

  • -na-
  • YYC = Calgary Alberta Canada airport code
View GitHub Profile
@jimf99
jimf99 / client.js
Created October 26, 2023 14:13 — forked from aerrity/client.js
Node, Express & MongoDB: Button click example
console.log('Client-side code running');
const button = document.getElementById('myButton');
button.addEventListener('click', function(e) {
console.log('button was clicked');
fetch('/clicked', {method: 'POST'})
.then(function(response) {
if(response.ok) {
console.log('click was recorded');
@hugodahl
hugodahl / SampleGuidance.ino
Last active May 28, 2024 05:14
Idea on Guidance for HugoBot in Arduino (semi-pseudo code)
#include "MeMegaPi.h"
#include "Arduino.h"
#include "SoftwareSerial.h"
// Define the pins/outputs that map to the individual motors
#define WHEEL_LF = PORT2B // Set to the pin for LEFT FRONT wheel
#define WHEEL_RF = PORT1A // Set to the pin for RIGHT FRONT wheel
#define WHEEL_LR = PORT2A // Set to the pin for LEFT REAR wheel
#define WHEEL_RR = PORT1B // Set to the pin for RIGHT REAR wheel
@Redstone-RM
Redstone-RM / micro-ROS_Arduino_Nano_RP2040_Connect.md
Last active September 12, 2024 02:50
Getting PlatformIO to install micro-ROS on Arduino Nano RP2040 Connect

Arduino Nano RP2040 Connect and micro-ROS

Goals:

Step 1. To get the board working with PlatformIO in VSCode with the micro-ROS Arduino library installed.

Step 2. Flash an example micro-ROS publisher app to the hardware.

@Integralist
Integralist / Go vs Rust - syntax differences.md
Last active October 7, 2024 21:48
[Go vs Rust: syntax differences] #go #golang #rust #rustlang #syntax

The following examples are written from the perspective of an engineer who writes code using the Go programming language, and so you'll find that I've written notes about how Rust is different and I don't really cover the why or how of the example Go code. Additionally, the Go examples are far from exhaustive because I'm using this as a 'scratch pad' for my Rust learnings.

Error Handling

Go example

@MarcoCiaramella
MarcoCiaramella / UDP.java
Last active April 22, 2023 13:07
UDP sender and receiver for Android.
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
@laemmy
laemmy / maidenhead.py
Created January 21, 2018 11:51
Convert latitude and longitude to Maidenhead grid locators.
# -*- coding: utf-8 -*-
import sys
# Convert latitude and longitude to Maidenhead grid locators.
#
# Arguments are in signed decimal latitude and longitude. For example,
# the location of my QTH Palo Alto, CA is: 37.429167, -122.138056 or
# in degrees, minutes, and seconds: 37° 24' 49" N 122° 6' 26" W
#
@aerrity
aerrity / client.js
Last active August 30, 2024 15:49
Node, Express & MongoDB: Button click example
console.log('Client-side code running');
const button = document.getElementById('myButton');
button.addEventListener('click', function(e) {
console.log('button was clicked');
fetch('/clicked', {method: 'POST'})
.then(function(response) {
if(response.ok) {
console.log('click was recorded');
@prasanthj
prasanthj / lirc-pi3.txt
Last active February 19, 2025 18:32
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@PhirePhly
PhirePhly / YTChanViewCounter.ino
Created June 25, 2017 20:25
YouTube API to MAX7219 display Widget
// YouTube Channel View Counter
// Kenneth Finnegan, 2017
//
// Given a WiFi SSID + password, and YouTube API key + channel ID, displays the
// current total views count on an attached MAX7219 eight digit display
#include <YoutubeApi.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active March 14, 2025 21:33
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');