Skip to content

Instantly share code, notes, and snippets.

View ahmedelgabri's full-sized avatar

Ahmed El Gabri ahmedelgabri

View GitHub Profile
ahmedelgabri /
Created March 13, 2024 09:03 — forked from lawrencejones/
Produce build telemetry from a MacBook

MacBook system information

You can run this script in order to extract various runtime and system measurements from a MacBook that might be relevant to performance.

This is a sample output:

  "id": "3d0f3c61-480e-4ace-9a65-c6e09ffd2dbd",
 "timestamp": "2023-12-12T19:38:27.013103Z",
ahmedelgabri /
Created March 3, 2024 14:22 — forked from timvisee/
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.


  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
ahmedelgabri /
Created April 10, 2023 15:44 — forked from fnky/
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
ahmedelgabri / vimModeStateDiagram.svg
Created March 28, 2021 15:22 — forked from darcyparker/vimModeStateDiagram.svg
Vim Modes Transition Diagram in SVG Note, most of the nodes in this graph have clickable hyperlinks to documentation.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ahmedelgabri / default
Last active September 25, 2020 09:00
# aerc default styleset
# This styleset uses the terminal defaults as its base.
# More information on how to configure the styleset can be found in
# the aerc-styleset(7) manpage. Please read the manual before
# modifying or creating a styleset.

Vim Script for Python Developers

A guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with programming in Python.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a similar guide for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, key-mapping, [abbrevi

Essential Apps

  • Blink: Install Blink on your iPad
  • Tailscale: Install Tailscale on all your devices.
  • mosh: Install mosh on all your devices. It comes with Blink by default.

Nice to have apps

Amphetamine for Mac

var unified = require('unified')
var markdown = require('remark-parse')
var remark2rehype = require('remark-rehype')
var html = require('rehype-stringify')
var report = require('vfile-reporter')
ahmedelgabri /
Created March 7, 2020 15:11 — forked from jasonrudolph/
Programming Achievements: How to Level Up as a Developer
ahmedelgabri /
Created July 2, 2019 08:09
global types in Typescript

I'm migrating a legacy codebase to Typescript & it has some global objects attached to window & I want these to be available always.

So I created globals.d.ts file that looks something like this

interface Foo {
  a: string;
  b: number;