Skip to content

Instantly share code, notes, and snippets.

View Dpbm's full-sized avatar
:shipit:
hello there!

Alexandre Dpbm

:shipit:
hello there!
View GitHub Profile
@Dpbm
Dpbm / tmux.md
Created November 15, 2022 11:57 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@Dpbm
Dpbm / archlinux-virtualbox.sh
Created December 9, 2022 22:17 — forked from GabLeRoux/archlinux-virtualbox.sh
Virtualbox archlinux notes
# sudo /sbin/rcvboxdrv -h
# Unloading modules:
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH
# Solution
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4
@Dpbm
Dpbm / logic.py
Created January 28, 2023 22:14 — forked from primaryobjects/logic.py
Quantum Computing logic gates for XOR, AND, NAND, OR using Qiskit.
from qiskit import qiskit, QuantumCircuit
def execute(func):
print('0 0: {}'.format(func(0, 0)))
print('0 1: {}'.format(func(0, 1)))
print('1 0: {}'.format(func(1, 0)))
print('1 1: {}'.format(func(1, 1)))
def xor(a, b):
"""
@Dpbm
Dpbm / compiling_asm.md
Created January 21, 2024 23:19 — forked from yellowbyte/compiling_asm.md
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
@Dpbm
Dpbm / circle-drawing.c
Created May 6, 2024 00:28 — forked from wldomiciano/circle-drawing.c
Drawing a normal and filled circle with SDL 2
#include <SDL.h>
SDL_Window* window;
SDL_Renderer* renderer;
void drawCircle(int xc, int yc, int x, int y) {
SDL_RenderDrawPoint(renderer, xc + x, yc + y);
SDL_RenderDrawPoint(renderer, xc - x, yc + y);
SDL_RenderDrawPoint(renderer, xc + x, yc - y);
@Dpbm
Dpbm / CMakeLists.txt
Created May 12, 2024 17:13 — forked from fracek/CMakeLists.txt
CMake and GTK+ 3
# Thanks to @danger89 and @Ilothar for updating the gist.
# Set the name and the supported language of the project
project(hello-world C CXX)
# Set the minimum version of cmake required to build this project
cmake_minimum_required(VERSION 3.10)
# Use the package PkgConfig to detect GTK+ headers/library files
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtkmm-3.0)