Skip to content

Instantly share code, notes, and snippets.

View ork's full-sized avatar
🥐

Benoît Taine ork

🥐
  • An tAontas Eorpach
View GitHub Profile
@ork
ork / Makefile
Last active January 8, 2022 17:29
Generic C Makefile
EXEC = $(shell basename $$(pwd))
CC = gcc
CFLAGS = -std=gnu11 -O3 -Wall -Wextra -Wpedantic -Wstrict-aliasing
CFLAGS += $(shell pkg-config --cflags glib-2.0 gio-2.0)
LDFLAGS = $(shell pkg-config --libs glib-2.0 gio-2.0)
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
@ork
ork / parseoui.awk
Last active February 20, 2022 23:17
Parse IEEE OUI vendor list to JSON
#!/usr/bin/awk -f
# Parse IEEE OUI vendor list to JSON
# http://standards.ieee.org/develop/regauth/oui/oui.txt
# ---
# Usage:
# $ chmod +x parseoui.awk
# $ wget http://standards.ieee.org/develop/regauth/oui/oui.txt
# $ ./parseoui.awk oui.txt > oui.json
BEGIN {
@ork
ork / section_anchor.js
Last active December 23, 2015 08:29
Add an anchor link reference to section headers.
[].forEach.call(document.querySelectorAll('h1,h2'), function(el) {
var section_anchor = document.createElement('a');
section_anchor.setAttribute('class', 'section_anchor');
section_anchor.setAttribute('title', 'Permalink');
section_anchor.setAttribute('href', '#' + el.id);
section_anchor.appendChild(document.createTextNode('¶'));
section_anchor.style.visibility = 'hidden';
el.appendChild(section_anchor);
el.addEventListener('mouseover', function() {