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 February 23, 2017 00:02
My solutions to Advent Of Code 2015 puzzles

Advent of Code - challenge 2015

@ClemRz
ClemRz / readme.md
Last active March 16, 2017 16:32
My solutions for the 1st Nearsoft Code Challenge puzzles

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 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
@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 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 August 31, 2017 20:38
This is how you download vectorial OSM data for your QGIS map

How to import OSM vectorial data into QGIS

Follow the steps:

  1. Go to https://www.openstreetmap.org and log in
  2. On the right, open the layer menu and check the public GPS trace
  3. On the top-left corner click on "Export"
  4. Enter the coordinates
  5. Click on Export button
  6. Open the file with a text editor
@ClemRz
ClemRz / _readme.md
Created February 7, 2018 16:54
This is how you add more file fileds to the GPS Visualizer convertion tool

How to add more file fields to the GPS Visualizer convertion tool

  1. Go to http://www.gpsvisualizer.com/ and choose a file converter
  2. Click the link Show additional file input boxes
  3. Open the developper tool's console
  4. Copy and paste the script below

Enjoy!

@ClemRz
ClemRz / print 2D Sketchup to scale.md
Last active March 3, 2018 18:59
How to print a 1:1 (or any scale) 2D graphic from a Sketchup Make 3D model

How to print a 1:1 (or any scale) 2D graphic from a Sketchup Make 3D model

  1. Export your model to STL file (Install the Sketchup STL extension: https://extensions.sketchup.com/en/content/sketchup-stl)
  2. Import the STL file in a new TinkerCAD model: https://www.tinkercad.com
  3. Export the TinkerCAD model to 2D SVG graphic
  4. Open the SVG file in Inkscape
  5. Make sure you page is correctly set up and print to the desired scale

The End

@ClemRz
ClemRz / QgsDetectLastFeature.py
Last active May 4, 2018 15:02
This python script can be used in QGIS actions. It allows to run a specific code on the very las feature when clicking on a stack of features.
from PyQt4.QtCore import QSettings
class Selection(QgsMapTool):
def __init__(self, canvas, layer):
QgsMapTool.__init__(self, canvas)
self.canvas = canvas
self.layer = layer
def getFeatureRequest(self):
sr = self.searchRadiusMU(self.canvas)