This file contains hidden or 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/env python3 | |
import socket | |
import ssl | |
import logging | |
import os | |
import sys | |
import re | |
import argparse | |
This file contains hidden or 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
/** | |
* Grid Traveler solution. | |
* | |
* Try running it with row=18 col=18 | |
*/ | |
#include <iostream> | |
#include <unordered_map> | |
using namespace std; |
This file contains hidden or 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 <string.h> | |
#include <errno.h> | |
unsigned long long int cstr_to_ull(const char* str) { | |
char* endptr = NULL; | |
errno = 0; | |
unsigned long long int ull_value = strtoull(str, &endptr, 10); | |
if (errno != 0) { |
This file contains hidden or 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
/** | |
* @file main.c | |
* @author Hugo Benicio <[email protected]> | |
* @brief Visitor Pattern implementation in C (not C++) | |
* @version 0.1.0 | |
* @date 2021-12-27 | |
*/ | |
#include <stdio.h> | |
#include <stddef.h> |
This file contains hidden or 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 <regex.h> | |
#include <sys/types.h> | |
#include <assert.h> | |
static void regex_must_compile(regex_t* regex, const char* pattern, int flags); | |
int main() { | |
const char* input = " \t a b c /* foo bar\nkk"; |
This file contains hidden or 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
SRC = \ | |
$(wildcard src/snake/*.c) | |
OBJ = $(SRC:.c=.o) | |
DEP = $(OBJ:.o=.d) | |
BIN = snake | |
# MMD will generate a .d file for each .c module containing its Makefile rules (including dependencies) | |
# These .d files are used with the `-include` bellow | |
CFLAGS = -Wall -Wextra -pedantic -std=c17 -MMD -I ./src/ | |
LDFLAGS = -Wall -Wextra -pedantic -std=c17 |
This file contains hidden or 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 <string.h> | |
#include <time.h> | |
#include <stdarg.h> | |
// Posix | |
#include <errno> | |
#ifndef LOG_RECORD_MSG_MAX_SIZE |
This file contains hidden or 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
/** | |
* Dynamic Dispatch example in C. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
#include <string.h> | |
typedef struct AllocatorInterface AllocatorInterface; | |
typedef struct Allocator Allocator; |
This file contains hidden or 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
/** | |
* Dynamic Dispatch example in C. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
#include <string.h> | |
typedef struct AllocatorInterface AllocatorInterface; | |
typedef struct Allocator Allocator; |
This file contains hidden or 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
const fs = require('fs'); | |
const path = require('path'); | |
const { pipeline } = require('stream/promises'); | |
async function generateFixtures() { | |
await Promise.all([ | |
generateFooFixture(), | |
generateBarFixture(), | |
generateCazFixture(), | |
//generateDazFixture(), |