Skip to content

Instantly share code, notes, and snippets.

View Nithanim's full-sized avatar

Nithanim

  • Somewhere with trains
  • Austria
View GitHub Profile
@kui
kui / gist:2622504
Last active February 25, 2024 19:21
get the active window on X window system.
// -*- coding:utf-8-unix; mode:c; -*-
//
// get the active window on X window system
//
#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
#include <X11/Xlib.h> // `apt-get install libx11-dev`
@derhuerst
derhuerst / _.md
Last active June 9, 2024 10:05
List of HAFAS API Endpoints
@ianmstew
ianmstew / plain-object-maps-typescript.md
Last active September 7, 2023 18:58
Plain objects as maps in TypeScript

So another 🤯 about TypeScript. We use plain objects as arbitrary maps all the time, but TypeScript deems that usage (correctly) too flexible.

const map = {};
map.foo = 'foo'; // Error: Property 'foo' does not exist on type '{}'.

Okay, then we need to type our object as a map: