Skip to content

Instantly share code, notes, and snippets.

View ebauger's full-sized avatar

Etienne Beaudry Auger ebauger

View GitHub Profile
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
1) ==== Autossh using systemd ====
Example from
https://gist.github.com/drmalex07/c0f9304deea566842490
2) =============
Install autossh

Keybase proof

I hereby claim:

  • I am ebauger on github.
  • I am ebauger (https://keybase.io/ebauger) on keybase.
  • I have a public key ASBFPNguplWTpibxzfLafUwOw9eSVvwPhNS2PZx4zScY5wo

To claim this, I am signing this object:

@ebauger
ebauger / python-sum-list-of-lists-to-a-list.md
Last active April 25, 2018 22:13
Python "sum" - Convert list-of-lists to a list

Some times you may face the case in which you have a list of lists (or tuples) as follows

lists_list = [ [1, 2], [3, 4], [5, 6] ]

tuples_list = [ (1, 2, 3), (4, 5, 6) ]

and you want to convert them into a single list as follows

alist = [1, 2, 3, 4, 5, 6] You can use loops and comprehensions of course!