Skip to content

Instantly share code, notes, and snippets.

View msiemens's full-sized avatar

Markus Siemens msiemens

View GitHub Profile
@msiemens
msiemens / types.c
Created May 24, 2014 18:01
Fundamental C Types
int main(void) {
char v_char;
unsigned char v_uchar;
short v_short;
unsigned short v_ushort;
int v_int;
unsigned int v_uint;
long v_long;
unsigned long v_ulong;
long long v_longlong;
@msiemens
msiemens / helpers.py
Last active August 29, 2015 14:04
My helpers.py file
"""
My compilation of small helper functions.
"""
import logging
import os
import threading
import traceback
import sys
from logging.handlers import SMTPHandler
@msiemens
msiemens / pre-commit-eslint
Last active October 15, 2016 13:49 — forked from linhmtran168/pre-commit-eslint
Pre-commit hook to check for Javascript using ESLint
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$" | grep -Ev ".min.js|/lib/|/vendor/")
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@msiemens
msiemens / README.md
Created May 14, 2017 20:18
List of German hyphenated words
@msiemens
msiemens / multi_byte.rs
Created February 27, 2021 11:12
ISF Multi-Byte Encoding (buggy!) and Decoding in Rust
//! Multi-byte encoding/decoding
//!
//! Following the multi-byte encoding described in [\[MS-ISF\]] (sections _Multi-byte Encoding of
//! Signed Numbers_ and _Sizes of Tags and Numbers_).
//!
//! [\[MS-ISF\]]: https://docs.microsoft.com/en-us/uwp/specifications/ink-serialized-format
use itertools::Itertools;
pub(crate) fn decode(input: &[u8]) -> Vec<u64> {