Skip to content

Instantly share code, notes, and snippets.

const std = @import("std");
const assert = std.debug.assert;
const cache_line = std.atomic.cache_line;
const AtomicUsize = std.atomic.Atomic(usize);
const Ordering = std.atomic.Ordering;
const Allocator = std.mem.Allocator;
// A modified version of Dmitry Vyukov's bounded MPMC queue,
// adapted for single-consumer usage:
@vbe0201
vbe0201 / day01.cpp
Last active December 3, 2021 19:11
My Advent of Code 2021 solutions written in C++
#include <algorithm>
#include <fstream>
#include <iostream>
#include <ranges>
#include <string>
void part1() {
std::ifstream input{"input.txt"};
auto view = std::ranges::istream_view<int>(input);
@vbe0201
vbe0201 / MakePattern.py
Last active November 4, 2021 22:45
Ghidra script that finds unique signature patterns for selected functions
# Finds unique signature patterns for selected functions
# @author Valentin B.
# @category Binary
from itertools import chain
from ghidra.program.model.lang import OperandType
def getSelectedFunction():
@vbe0201
vbe0201 / baby-cpp.cpp
Last active November 16, 2020 10:01
baby-cpp reimplementation - decompetition.io
/* decompetition.io tiny-cpp reimplementation */
#include <iostream>
#include <string>
#include <vector>
/* Function prototypes */
bool check(const std::string& hand, const std::string& word);
int score(const std::string& word);
@vbe0201
vbe0201 / Abschluss.java
Last active January 10, 2020 17:26
Implementation einer einfach verketteten Liste in Java.
/**
* Ein Listenelement, welches den Abschluss und damit den
* letzten Knoten einer verketteten Liste darstellt.
*
* @author Valentin B.
* @version 01/10/2020
*/
public class Abschluss<T> implements Listenelement<T> {
public int restlaengeGeben() {
return 0;
@vbe0201
vbe0201 / AlefCrypto.cs
Created July 16, 2019 18:59
Implementation of the Blowfish algorithm in C#
using System;
using System.Text;
namespace AlefCrypto
{
/// <summary>
/// Table that holds subkey arrays for the Blowfish implementation.
/// </summary>
static class BlowfishTable
{
@vbe0201
vbe0201 / gmail_confidential_mail_dumper.py
Last active June 2, 2019 20:07
A proof of concept to dumping the contents of mails sent from Gmail's new Confidential Mode
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is a proof of concept to dumping the contents of mails
sent from Gmail's new Confidential Mode.
The entire "security" can be defeated by obtaining the cookies
for such a confidential mail. Use the network tab of your browser.
Intercept network calls while opening such a mail in confidential
@vbe0201
vbe0201 / get-python.sh
Last active August 16, 2023 19:56
A script to install Python 3.7.2 on your Debian, Ubuntu or Mint server.
#!/bin/bash
#
# A bash script for installing Python 3.7.2 on your Debian, Ubuntu or Mint server.
# (c) 2019 Valentin B.
#
# Open your terminal and enter the following command:
# wget https://gist.github.com/vbe0201/b85ec47bc198d1c8471acbf016922005/raw/get-python.sh && chmod +x get-python.sh && ./get-python.sh
apt update -y
apt upgrade
@vbe0201
vbe0201 / raspberry_python.sh
Last active December 1, 2023 01:57
A shell script for installing Python 3.7.3 on your Raspberry Pi.
#!/bin/bash
# A bash script for installing Python 3.7.3 on your Raspberry Pi.
# (c) 2018 Valentin B.
#
# Open your terminal and type the following command:
# sudo wget https://gist.githubusercontent.com/itsVale/5619215a46d363ece9fc7cdfdfa301c8/raw/raspberry_python.sh && chmod +x raspberry_python.sh && ./raspberry_python.sh
sudo apt-get update -y
sudo apt-get upgrade
@vbe0201
vbe0201 / ackermann.py
Created October 12, 2018 16:08
An implementation of the Ackermann function in Python.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
class Ackermann:
def __init__(self):
self.count = 0