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 / cornichon.py
Created August 7, 2016 16:04
Python Gtk3 Steam client
#!/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):
@ork
ork / wine_version.c
Created August 19, 2015 10:01
Wine version detector and dll procedure wrapper
#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) \
@ork
ork / colissymo.py
Last active January 8, 2022 17:29
Colissymo
#!/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/'
@ork
ork / fuzzy_search.c
Last active August 29, 2015 14:25
Fuzzy string search
#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);
@ork
ork / sdl2_context.c
Created June 10, 2015 09:46
SDL2 context example
#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
*/
@ork
ork / free_sms
Last active August 29, 2015 14:02
Send SMS using the Free Mobile gateway.
#!/usr/bin/env bash
## User config
FREE_USER=${FREE_USER:-'MY_LOGIN'}
FREE_PASS=${FREE_PASS:-'MY_API_KEY'}
## Go go go
FREE_URI='https://smsapi.free-mobile.fr/sendmsg'
@ork
ork / .Xresources
Created May 25, 2014 10:03
URxvt configuration file
! Window
URxvt.scrollBar: false
URxvt.borderLess: true
URxvt.internalBorder: 0
URxvt.externalBorder: 0
URxvt.iconFile: /usr/share/icons/Faenza/apps/16/terminal.png
! Fonts
URxvt.font: xft:Monospace:size=9
URxvt.depth: 32
@ork
ork / Example.md
Created May 15, 2014 14:48
Print GameBoy VRAM tiles in your terminal

Source

00333300
03111130
31111213
31111113
31211113
31221113
@ork
ork / Makefile
Created May 15, 2014 09:39
Generic LaTeX Makefile using latexmk and lualatex
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
@ork
ork / no_more_ifconfig
Last active January 8, 2022 17:29
Network interface stats
$ 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