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 <setjmp.h> | |
typedef unsigned long long __u64; | |
#define get_rsp(into) \ | |
__asm__ __volatile__("movq %%rsp, %0;" : "=m"(into) :: "memory") | |
#ifndef PUSH_RET_ADDR |
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/python | |
# Stefano Belli | |
# Digital Green Certificate decoder and validator 4fun | |
# Changelog | |
# * -- First change since publishing -- | |
# - fix datetime.now offset-awareness | |
# - fix incorrect vaccine data retrieved from DGC led to wrong test results | |
# - fix incorrect comparison between dose number and scheduled total doses to check vaccination completeness |
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
#!/bin/bash | |
DL="https://teams.microsoft.com/downloads/desktopurl?env=production&plat=linux&arch=x64&download=true&linuxArchiveType=deb" | |
BUILDDIR=/tmp/teams-build | |
PRIV="sudo" | |
if ! which wget 2>/dev/null >>/dev/null; then | |
echo "unable to find wget" | |
exit 1 | |
fi |
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
SHELL = /bin/bash | |
CC = gcc | |
OBJECT_FLAG = -c | |
CFLAGS = -O2 -pedantic -std=c99 -Wall -Wextra -Wshadow -W | |
LIBS = -lexample | |
OBJS = example.o | |
OUT = example | |
SUPPRESS_OUTPUT = > /dev/null 2>&1 | |
all:$(OBJS) |
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
// SANE API usage example | |
// link against libsane | |
// --> http://www.sane-project.org/html/doc012.html | |
#include <sane/sane.h> | |
#include <stdio.h> | |
int main() { | |
// | |
// Initialize SANE | |
// |
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> | |
void ClearConsole(HANDLE console) { | |
const COORD origin = { 0,0 }; | |
DWORD writtenBytes; | |
DWORD consoleSize; | |
CONSOLE_SCREEN_BUFFER_INFO info; | |
GetConsoleScreenBufferInfo(console, &info); |
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
# | |
# smalloc.S | |
# | |
# Simple Malloc implementation for sysh, libc-independent | |
# | |
# IF ARCH IS x86_64 THEN | |
# STRUCT (block_header) : { | |
# DATA_SIZE off 0 | |
# _FREE_BLK off 8 |
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
//gcc showstats.c -lwiringPi -lwiringPiDev | |
#define ROWS 2 | |
#define COLS 16 | |
#define RS 1 | |
#define EN 4 | |
#define D7 7 | |
#define D6 0 | |
#define D5 2 | |
#define D4 3 |
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
// x86_fast_string.cpp | |
#include <nmmintrin.h> | |
#include <immintrin.h> | |
#include <cstdint> | |
#if defined(_MSC_VER) | |
#define x86_fetch_eflags(mem_dst_32) \ | |
__asm { \ | |
__asm pushfd \ |
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
#ifndef NUMERIC_H | |
#define NUMERIC_H | |
#include <initializer_list> | |
#include <type_traits> | |
#include <sstream> | |
#include <string> | |
#include <exception> | |
#include <vector> | |
#include <array> |
NewerOlder