Skip to content

Instantly share code, notes, and snippets.

View franky47's full-sized avatar

François Best franky47

View GitHub Profile
franky47 / 00-header
Last active July 1, 2016 07:49
RasPi 3 Dynamic MOTD à la Ubuntu
View 00-header
# 00-header - create the header of the MOTD
# Copyright (c) 2013 Nick Charlton
# Copyright (c) 2009-2010 Canonical Ltd.
# Authors: Francois Best <>
# Nick Charlton <>
# Dustin Kirkland <>
franky47 / noteBuffer.cpp
Last active October 29, 2016 06:38
Snippet for Neil
View noteBuffer.cpp
#include <iostream>
#include <inttypes.h>
#include <cstring>
#define _STRINGIFY(LitteralString) #LitteralString
#define STRINGIFY(LitteralString) _STRINGIFY(LitteralString)
#define ASSERT(expr) \
{ \
if (!(expr)) \
{ \
franky47 /
Created September 20, 2017 04:54
Get a robotic avatar of your environment variables setup
#!/usr/bin/env bash
# This simple line lists your environment variables,
# hashes them into a SHA-1 and uses that to query a "unique"
# robotic avatar from
# This lets you see quickly if something is out of place in
# a server configuration, as any slight change of the config
# will result in a totally different image, which is easier
# to catch at a glimpse than remembering checksums.
franky47 /
Last active December 26, 2017 13:17
Front-End URL Farm

Keybase proof

I hereby claim:

  • I am franky47 on github.
  • I am franky47 ( on keybase.
  • I have a public key whose fingerprint is 4A13 03D1 C816 DF95 5713 661E ED1B 3C13 7048 076B

To claim this, I am signing this object:

franky47 / hosts
Last active December 7, 2018 08:05
Block undesired web services from even resolving their DNS
View hosts
# Block Facebook IPv4
franky47 /
Created January 11, 2019 08:18
List of lists
franky47 / .zprofile
Created February 3, 2019 12:51
System status MOTD for Raspberry Pi (with ZSH)
View .zprofile
# Inspiration:
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %dh %dm %ds" "$days" "$hours" "$mins" "$secs"`
# get the load averages


Unsplash practical progressively enhanced responsive optimised images

Unsplash has the best free pictures out there.

However, their delivery is painful if you want to follow all the best practices:

  • Optimised images, to avoid sending useless bytes over the wire
  • Responsive to deliver the right image for the right screen size
franky47 / useDerivedState.ts
Last active May 21, 2019 06:20
React useDerivedState hook
View useDerivedState.ts
import React from 'react'
const useDerivedState = <T>(derive: () => T, deps: any[]): T => {
const [value, setValue] = React.useState<T>(derive)
React.useEffect(() => {
}, deps)
return value