Skip to content

Instantly share code, notes, and snippets.

fdelbos /
Created February 18, 2023 02:15
A shell script to calculate the days between 2 dates with postgres
echo "Use the following format: yyyy-mm-dd (ex: 2022-01-15)"
echo "First day: "
echo "Last day: "
fdelbos / Configuring Qt 6.x and CMake for windows
Last active February 10, 2023 03:58
Configuring Qt 6.x and CMake for windows 10
View Configuring Qt 6.x and CMake for windows

Configuring Qt 6.x and CMake for windows 10

If you want to create a redistributable installer for a Qt app with Cmake then youve come to the right place... I ve been struggling to make Qt work with cmake on windows, and finally figure out something that works:

  1. Go ahead and download Qt:

  2. Start the install and select "Custom installation" image11

fdelbos / STM32 project
Last active February 10, 2023 03:59
STM32 project setup with cmake and CubeMX
View STM32 project

STM32 project setup


Install gcc arm none eabi

We will install gcc in an upper directory, so that we can reuse it in all our projects

  • create the dir: mkdir stm32 && cd stm32
  • go to the download page and find the latest version
fdelbos / .bashrc
Last active June 7, 2020 08:49
base docker config files
View .bashrc
PAGER=less; export PAGER
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export HISTCONTROL=ignoreboth:erasedups
alias l='ls -lah'
alias c='cat'
alias e='emacs'
fdelbos / .emacs
Last active July 6, 2018 08:10
be .emacs
View .emacs
;; melpa
(require 'package)
(add-to-list 'package-archives '("melpa" . ""))
;; theme
(load-theme 'manoj-dark)
(global-linum-mode t)
fdelbos / encryption.js
Created October 29, 2017 16:09
a quick way to aes encrypt with node
View encryption.js
const crypto = require('crypto');
const IV_LENGTH = 16;
class Encryption {
constructor(b64Key) {
this.key = Buffer.from(b64Key, 'base64');
fdelbos / s3_image_upload.go
Last active August 29, 2015 14:20
Resize an image, create a thumbnail, compress and uploads to S3
View s3_image_upload.go
package main
import (
View gist:230c8829b263fc95430c
# encrypt
openssl enc -aes-256-cbc -in myfile.tar -out myfile.tar.enc
# decrypt
openssl enc -aes-256-cbc -d -in myfile.tar.enc -out myfile.tar
fdelbos /
Last active February 17, 2020 13:38
FreeBSD 10 Nodejs setup with nginx, mongo and monit

FreeBSD 10 Nodejs setup with nginx, mongodb, redis and monit

This my receipe for installing a complete nodejs server on FreeBSD 10. The parameters used in this configuration are for a very small private server that I use for demo purpose only, so for a production server, you should somehow set the limits in pair with your ressources.

I use monit so I don't have to write rc scripts for node and it should take care of process lifecycle management for me. Alternatives exists such as supervisord or circus.

Installing mongodb

View header2.el
;;; header2.el --- Support for creation and update of file headers.
;; Filename: header2.el
;; Description: Support for creation and update of file headers.
;; Author: Lynn Slater
;; Drew Adams
;; Maintainer: Drew Adams
;; Copyright (C) 1996-2013, Drew Adams, all rights reserved.
;; Copyright (C) 1989 Free Software Foundation, Inc.
;; Copyright (C) 1988 Lynn Randolph Slater, Jr.