This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdbool.h> | |
#include <SDL2/SDL.h> | |
#define PICTURE_SIZE_WIDTH 640 | |
#define PICTURE_SIZE_HEIGHT 480 | |
#define PICTURE_AT(x, y) (y * PICTURE_SIZE_WIDTH + x) | |
/* | |
* Declarations | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <stdio.h> | |
// FIXME Pass arguments to proc() | |
#define WRAP_DLL_PROC(_type, _proc, _dll, _default, ...) \ | |
_type _proc(__VA_ARGS__) \ | |
{ \ | |
HMODULE dll = GetModuleHandle(_dll); \ | |
\ | |
if (!dll) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import gi | |
gi.require_version('Gtk', '3.0') | |
from gi.repository import GdkPixbuf, Gtk, Soup | |
import glob | |
class LocalSteam: | |
@property | |
def installed_games(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
from bs4 import BeautifulSoup | |
from datetime import datetime | |
class Colissymo(object): | |
__UA_STRING = 'Mozilla/5.0 (Colissymo)' | |
__ROOT_URI = 'http://www.colissimo.fr/portail_colissimo/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAINDOC = $(shell basename $$(pwd)) | |
LTXARGS = -pdf -lualatex -use-make | |
.PHONY: $(MAINDOC).pdf all clean | |
all: $(MAINDOC).pdf | |
$(MAINDOC).pdf: $(MAINDOC).tex | |
latexmk $(LTXARGS) $(MAINDOC).tex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ awk -F ' ' 'NR > 2 {printf("%-20s\n\tRX%15s packets\n\t%17s bytes\n\tTX%15s packets\n\t%17s bytes\n", $1, $3, $2, $11, $10);}' < /proc/net/dev | |
wlp2s0: | |
RX 13207 packets | |
2346094 bytes | |
TX 212 packets | |
44302 bytes | |
lo: | |
RX 131602 packets | |
13078892 bytes | |
TX 131602 packets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
static bool | |
_fuzzy_search(const char *needle, const char *haystack) | |
{ | |
size_t hlen = strlen(haystack); | |
size_t nlen = strlen(needle); |
NewerOlder