Skip to content

Instantly share code, notes, and snippets.

@phelian
phelian / movmeta
Last active November 14, 2024 17:10
Golang: Read creation time from mov/mp4
package main
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
"os"
"time"
@Aerijo
Aerijo / making_language_grammar.md
Last active September 20, 2025 20:59
Guide to writing an Atom language grammar

A guide to writing a language grammar (TextMate) in Atom

Tree sitter

  • Atom is transitioning to an entirely new way of defining grammars using tree-sitter. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and check Use Tree Sitter Parsers

Links for tree-sitter help:

How to setup a minimal X11 environment on Debian GNU/Linux

  1. Install the following packages

    • xserver-xorg-core (server)
    • xserver-xorg-video-XXX (video driver, XXX depends on your hardware)
    • xserver-xorg-input-XXX (input device driver, XXX depends on your hardware. evdev works well for most cases)
    • x11-xserver-utils (xmodmap, xrandr)
    • x11-xkb-utils (setxkbmap)
  • x11-utils (xdpyinfo, xev, xkill, xprop, xwininfo)
@ar-pa
ar-pa / BigInt.cpp
Last active August 11, 2025 06:54
bignum class for C++
// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e2 + 14, lg = 15;

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: