Skip to content

Instantly share code, notes, and snippets.

View barnabyrobson's full-sized avatar

Barnaby Robson barnabyrobson

  • ILM
  • San Francisco, CA
View GitHub Profile
@safijari
safijari / CMakeLists.txt
Created April 1, 2021 20:56
The code relevant to pybind11 video
cmake_minimum_required(VERSION 3.4...3.18)
project(pybindtest)
add_subdirectory(pybind11)
pybind11_add_module(module_name main.cpp)
@oprypin
oprypin / instructions.md
Last active June 19, 2024 08:16
systemd user unit + timer example

Save these files as ~/.config/systemd/user/some-service-name.*

Run this now and after any modifications: systemctl --user daemon-reload

Try out the service (oneshot): systemctl --user start some-service-name

Check logs if something is wrong: journalctl -u --user-unit some-service-name

Start the timer after this user logs in: systemctl --user enable --now some-service-name.timer

/*
* Compile with -lxcb -lxcb-randr
*/
#include <stdio.h>
#include <stdlib.h>
#include <xcb/xcb.h>
#include <xcb/randr.h>
int main() {
@gvx
gvx / named.py
Created December 11, 2014 23:28
An alternative namedtuple
from collections import OrderedDict
from inspect import Parameter, signature
from itertools import chain, starmap
from operator import itemgetter
__all__ = ['namedtuple']
dict_property = property(lambda self: OrderedDict(zip(self._fields, self)),
doc='dictionary for instance variables (if defined)')