Skip to content

Instantly share code, notes, and snippets.

View albinekb's full-sized avatar
🤖
AgentAgentAgentAgentAgent

Albin Ekblom albinekb

🤖
AgentAgentAgentAgentAgent
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
@albinekb
albinekb / Dockerfile
Created May 28, 2017 21:50 — forked from eduardoromero/Dockerfile
Dockerfile for Node 7 with xvfb
FROM node:7
RUN apt-get update &&\
apt-get install -y libgtk2.0-0 libgconf-2-4 \
libasound2 libxtst6 libxss1 libnss3 xvfb
# Exposing port 5000 (micro)
EXPOSE 5000
WORKDIR /app
@albinekb
albinekb / start-services.sh
Created May 28, 2017 21:50 — forked from eduardoromero/start-services.sh
Starting Xvfb with start-services.sh
#!/usr/bin/env bash
set -e
# Start Xvfb
Xvfb -ac -screen scrn 1280x800x24 :9.0 &
export DISPLAY=:9.0
exec "$@"