Skip to content

Instantly share code, notes, and snippets.

View bernardoamc's full-sized avatar

Bernardo de Araujo bernardoamc

View GitHub Profile
@bernardoamc
bernardoamc / style.css
Created July 16, 2019 01:41
Style CSS
main {
width: 100%;
padding: 15px;
}
.catalogue-item {
border: 1px solid #e5e5e5;
color: #555;
display: block;
padding: 2rem 0;

This is explaining stuff relevant to AOC 2021 day 6

How is a matrix used to count fish?

First lets do fibonacci numbers because it's smaller (2x2 matrix instead of 9x9) and it's familiar ground.

So you can implement fibs like this:

def fib(n):
@bernardoamc
bernardoamc / push-to-someone-elses-pr.md
Created June 9, 2023 15:32 — forked from wtbarnes/push-to-someone-elses-pr.md
Brief instructions for how to modify and push to someone else's PR on github

How to Push to Someone Else's Pull Request

Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their branch feature and have proposed to merge this into origin/master, where

origin -> https://github.com/author/repo.git

Now say you would like to make commits to their PR and push those changes. First, add their fork as a remote called

@bernardoamc
bernardoamc / basicbof.c
Created November 10, 2023 22:17 — forked from moyix/basicbof.c
Buffer overflow with two ROP chains
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// Build:
// gcc -gdwarf-4 -fcf-protection=none -no-pie -fno-stack-protector basicbof.c -o basicbof
// To give us a pop rdi gadget
void dosomething() {
int x = 0xc35f;