Skip to content

Instantly share code, notes, and snippets.

View Nosferatu31's full-sized avatar

Gabriel Fernandes Nosferatu31

  • Q-Better
  • Braga, Portugal
View GitHub Profile
@Nosferatu31
Nosferatu31 / main.py
Created May 13, 2022 15:24
AWS ECR tag multi-arch images
import typer
import json
import subprocess
IMAGE_INDEX_IMAGE_MANIFEST_MEDIA_TYPE="application/vnd.docker.distribution.manifest.list.v2+json"
DEFAULT_NEW_TAG_TEMPLATE="{image_index_tag}-{platform_os}-{platform_arch}"
GET_MANIFEST_COMMAND_TEMPLATE="MANIFEST=$(aws ecr batch-get-image --repository-name {repo_name} --image-ids imageDigest='{digest}' --output json | jq --raw-output --join-output '.images[0].imageManifest')"
PUT_IMAGE_COMMAND_TEMPLATE='aws ecr put-image --repository-name {repo_name} --image-tag {tag} --image-manifest \"$MANIFEST\"'
def get_tag_from_image(image):
@Nosferatu31
Nosferatu31 / avl.h
Created October 25, 2016 22:10
Generic AVL trees module in C (Header)
typedef enum balancefactor { LH , EH , RH } BalanceFactor;
typedef struct treenode *Tree;
Tree createTree(void);
void emptyTree(Tree t);
int treeHeight(Tree t);
int treeSize(Tree t);
int isEmpty(Tree t);
@Nosferatu31
Nosferatu31 / avl.c
Created October 25, 2016 22:10
Generic AVL trees module in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "avl.h"
typedef struct treenode{
BalanceFactor bf;
void* entry;
struct treenode *left;
struct treenode *right;
@Nosferatu31
Nosferatu31 / logoUM.tex
Created October 25, 2016 22:05
Logo da Universidade do Minho e da Escola de Engenharia
% Autor: Professor José Nuno Oliveira
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
% Define Colors
\definecolor{eng}{cmyk}{0.14,0.71,1,0.03}
\definecolor{um}{cmyk}{0.25,1.00,1.00,0.22}