Le document a été migré ici
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 <stddef.h> | |
#include <stdio.h> | |
#define ARR_SIZE(...) (sizeof(__VA_ARGS__) / sizeof((__VA_ARGS__)[0])) | |
#define FOREACH_ARR(Type, IName, ...) \ | |
for (struct \ | |
{ \ | |
size_t i; \ |
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
import sys | |
import yaml | |
import argparse | |
class ConfigParser(): | |
def __init__(self, *pargs, **kwpargs): | |
self.options = [] | |
self.pargs = pargs | |
self.kwpargs = kwpargs |
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
__cleanup_hook_i=0 | |
__cleanup_hook () { | |
for ((i=__cleanup_hook_i - 1; i >= 0; i--)); do | |
eval "\"\${__cleanup_hook_action_${i}[@]}\"" | |
done | |
} | |
trap __cleanup_hook EXIT |
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 <stdint.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
// random hash implementation from the internet | |
#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k)))) | |
#define mix(a, b, c) \ | |
{ \ |
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
## A workspace manager | |
: ${WS_CONFIG_DIR:=~/.config/ws} | |
ws_l () { | |
for ws_file in "${WS_CONFIG_DIR}"/*.ws; do | |
local ws_name="$(basename "$ws_file")" | |
ws_name="${ws_name%.ws}" | |
printf "%-10s\t%s\n" "$ws_name" "$(cat "${ws_file}")" | |
done |
Il y a beaucoup, mais alors beaucoup de manières d'implémenter un allocateur mémoire. Trop pour les lister ici sans y passer vraiment beaucoup de temps. Ainsi, seuls les aspects généraux seront évoqués.
Si vous lisez ce message, c'est que votre malloc ne marche pas. Terrible, non ? Que faire !
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
import sys | |
import json | |
from datetime import datetime | |
def fixup_str(text): | |
return text.encode('latin1').decode('utf8') | |
def fixup_list(l): |
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
*nat | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
COMMIT | |
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] |
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
(setq c-default-style "bsd" | |
c-basic-offset 4) | |
(setq-default indent-tabs-mode nil) | |
(require 'whitespace) | |
(setq require-final-newline t) | |
(setq whitespace-style '(face empty tabs trailing lines-tail)) | |
(global-whitespace-mode t) |
OlderNewer