- para tasks com contexto Send (i.e. type parameters da future implementam Send)
- para tasks com contexto !Send (tasks serão "scheduladas" na mesma thread!)
- deve-se criar um objeto task::LocalSet
# Para instalar o GnuPG2 no Ubuntu | |
sudo apt install gnupg2 | |
# Para criar novas chaves | |
gpg2 --full-gen-key | |
# Para listar as chaves | |
gpg2 --list-secret-keys --keyid-format LONG | |
# Para exportar chaves |
# Show git branch name | |
# @see https://askubuntu.com/questions/730754/how-do-i-show-the-git-branch-with-colours-in-bash-prompt | |
force_color_prompt=yes | |
color_prompt=yes | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' | |
else |
#!/bin/bash | |
set -eu -o pipefail | |
HOST="foo.bar" | |
PORT="443" | |
CERTS_FILE_PATH="certs.pem" | |
openssl s_client \ | |
-showcerts \ | |
-connect "${HOST}:${PORT}" < /dev/null 2> /dev/null \ |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <stdbool.h> | |
#define OUTCOME_SUCCESS 0 | |
typedef double DivResultOk; | |
// TODO For a generic error handling, you coud add a polimorphic interface here. This could help for generec error handling and error chaining. |
const fs = require('fs'); | |
const path = require('path'); | |
const { pipeline } = require('stream/promises'); | |
async function generateFixtures() { | |
await Promise.all([ | |
generateFooFixture(), | |
generateBarFixture(), | |
generateCazFixture(), | |
//generateDazFixture(), |
/** | |
* 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; |
/** | |
* 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; |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <stdarg.h> | |
// Posix | |
#include <errno> | |
#ifndef LOG_RECORD_MSG_MAX_SIZE |
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 |