Skip to content

Instantly share code, notes, and snippets.

View ClemRz's full-sized avatar
💰
Doing cool stuff for fintech industry

Clément Ronzon ClemRz

💰
Doing cool stuff for fintech industry
View GitHub Profile
@ClemRz
ClemRz / readme.md
Last active November 19, 2023 16:11
How to pass a callback function as an argument (Arduino, C++)

How to pass a callback function as an argument (Arduino, C++)

Arduino Uno:

bool myCallback(int value) {
  // here your custom logic
  return status;
}
@ClemRz
ClemRz / readme.md
Last active July 6, 2017 16:35
How to override a class in C++ in an Arduino environment

How to override a class in C++ in an Arduino environment

I was working on a custom firmware for ESP8266 using the famous Arduino library and I wanted to create a websocket server. I also wanted the EPS to serve the web page that acts as a websocket server (having the ESP in AP mode).

The awesome library ArduinoWebSockets is very easy to set up and make the ESP serve websockets connections on port 81. The thing is that when I was opening a browser at http://192.168.4.1:81 I had this message: "This is a Websocket server only!". Wow! This means that ESP is capable of returning a http message to the browser! This also means that the message could be tweaked to include the actual html page with the websocket JS client!

I looked at the library file WebSocketsServer.h and found that the method handleNonWebsocketConnection was the one sending this message.

@ClemRz
ClemRz / readme.md
Last active October 1, 2018 17:48
Removes inaccurate point from a GPS trace.

Filter a KML by HDOP value

Sometimes a trace KML file obtained from a GPS has some points with high HDOP value. Those are usually not accurate and can be omitted from the trace.

How to use this script

Then open a terminal and run:

python zFilterByHdop.py /path/to/your/file.kml
@ClemRz
ClemRz / readme.md
Last active May 11, 2017 15:24
This is how you synchronise your photos with a GPS track in order to geoloc them

How to synchronise your photos with a GPS track

Install ExifTool and run the following in a terminal:

exiftool -geotag="/path/to/your/GPS/track.kml" -geosync=7:00:00 /path/to/your/photos/folder

The geosync parameter is used when your GPS track is not in the same timezone as your photos. In the above example the GPS track is in the UTC timezone while the photos are in UTC-7.

@ClemRz
ClemRz / readme.md
Last active May 11, 2017 15:15
This is how you convert GPX files (or any other file) to fit for the Navilink software / Locosys BGT-31 GPS.

Convert GPS files for Navilink (Locosys BGT-31 GPS)

This is how you convert GPX files (or any other file) to fit for the Navilink software / Locosys BGT-31 GPS.

Convert a GPX file to a waypoint file (OziExplorer format: wpt)

Install GPSBabel then run the following in your terminal:

gpsbabel -i gpx -f your-input-file-name.gpx -o ozi -F your-waypoint-file-name

Ible Sort

This Gist shows how to quickly sort the Instructables entries in a contest.

How to

First you need to know the Contest ID. Follow the steps:

  • Open the developper tools of your browser and navigate to the contest page
  • in the network tab search for getContestEntries.json
@ClemRz
ClemRz / readme.md
Last active March 16, 2017 16:32
My solutions for the 1st Nearsoft Code Challenge puzzles
@ClemRz
ClemRz / readme.md
Last active February 23, 2017 00:02
My solutions to Advent Of Code 2015 puzzles

Advent of Code - challenge 2015