Skip to content

Instantly share code, notes, and snippets.

View gullradriel's full-sized avatar
💭
Coding !

gullradriel gullradriel

💭
Coding !
View GitHub Profile
@linneman
linneman / enum_stringify_example.c
Created July 14, 2016 08:23
how to stringify an enumeration type in C
#include <stdio.h>
#include <stdio.h>
#define ENUM_BODY(name, value) \
name value,
#define AS_STRING_CASE(name, value) \
case name: return #name;
#define DEFINE_ENUM(name, list) \
@vszakats
vszakats / s3-upload-aws4.sh
Last active September 26, 2024 12:27
AWS S3 upload using signature v4
#!/bin/sh
# To the extent possible under law, Viktor Szakats
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# SPDX-License-Identifier: CC0-1.0
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@rampion
rampion / try-catch-ex.c
Created April 8, 2009 02:35
TRY/CATCH/FINALLY macros for C
// gcc -o try-catch-ex try-catch.c try-catch-ex.c
#include <stdio.h>
#include "try-catch.h"
// Example of use for try-catch.h
int main(int argc, char *argv[])
{
int i = 101;
printf("before try block...\n");