Skip to content

Instantly share code, notes, and snippets.

import os
import re
import subprocess
include_map = {}
include_re = re.compile(r'#include "([^"]+)"')
for fn in subprocess.check_output(['git', 'ls-files', '*.h', '*.c'], text=True).splitlines():
if fn.startswith('cras/include/'):
continue
#!/usr/bin/env python3
import datetime
import string
keys = string.digits + string.ascii_letters
now = datetime.datetime.now()
@afq984
afq984 / keyboardLayout.json
Created July 11, 2022 04:46 — forked from tdegrunt/keyboardLayout.json
Colemak VSCode keyboard layout
{
"layout": {
"id": "com.apple.keylayout.Colemak",
"localizedName": "Colemak",
"lang": "en"
},
"rawMapping": {
"KeyA": {
"value": "a",
"valueIsDeadKey": false,
import argparse
import sys
import tokenize
def professional(filename):
result = []
line = 0
displacement = 0
import contextlib
import mmap
import os
def floatcmp(a, b):
size = os.path.getsize(a)
if size != os.path.getsize(b):
return False
with contextlib.ExitStack() as stack:
package main
import (
"fmt"
"image"
"image/png"
"os"
)
func mustReadImage(filename string) image.Image {
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv) {
MPI_Init(&argc, &argv);
int rank;
int ranks;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@afq984
afq984 / gist:f2b5ab210eecffb71065bd1e2295e335
Created September 30, 2017 05:16
yay -S --noconfirm numix-circle-icon-theme-git
[afg@vbox ~]$ ~/go/bin/yay -S --noconfirm numix-circle-icon-theme-git
==> Installing numix-circle-icon-theme-git
=> Run Dependencies:
==> AUR dependencies: numix-icon-theme-git
==> Installing numix-icon-theme-git
=> Run Dependencies:
==> Repository dependencies: gtk-update-icon-cache
resolving dependencies...
looking for conflicting packages...
@afq984
afq984 / classes.py
Created August 12, 2017 13:06
Where can I import my PyQt5 class?
from PyQt5.Enginio import Enginio
from PyQt5.Enginio import EnginioClient
from PyQt5.Enginio import EnginioClientConnection
from PyQt5.Enginio import EnginioIdentity
from PyQt5.Enginio import EnginioModel
from PyQt5.Enginio import EnginioOAuth2Authentication
from PyQt5.Enginio import EnginioReply
from PyQt5.QtCore import QAbstractAnimation
from PyQt5.QtWidgets import QAbstractButton
from PyQt5.QtCore import QAbstractEventDispatcher
#!/usr/bin/env python2
import sys
import re
import subprocess
import itertools
_find_unsafe = re.compile(r'[^\w@%+=:,./-]').search