Skip to content

Instantly share code, notes, and snippets.

View phoemur's full-sized avatar

phoemur phoemur

  • Avaré-SP, Brazil
View GitHub Profile
@phoemur
phoemur / Aho.hpp
Created December 12, 2018 23:31
Aho-Corasick algorithm in C++
#ifndef AHO_CORASICK_HEADER
#define AHO_CORASICK_HEADER
#include <queue>
#include <unordered_map>
#include <vector>
#include <iostream>
// Reference https://www.toptal.com/algorithms/aho-corasick-algorithm
@phoemur
phoemur / printargs.asm
Created July 9, 2023 16:57
asm to print command line arguments
section .data
EXIT_SUCCESS equ 0 ; successful operation
SYS_exit equ 60 ; call code for terminate
linefeed db 10
stringRes db "Number of arguments: "
section .text
global _start
@phoemur
phoemur / cat.asm
Created July 9, 2023 21:51
Simple program emulating UNIX cat
; Simple program emulating UNIX cat
;
; Assembler: YASM
;
; Fernando Giannasi
; July 09, 2023
section .data
SYS_EXIT equ 60
@phoemur
phoemur / quicksort.asm
Created July 23, 2023 01:22
Quicksort example in x86_64 Assembly - Linux
; Quicksort example in x86_64 Assembly - Linux
; Assembler: NASM
; Fernando B. Giannasi - jul/2023
section .data
DATA dq 1, 9, 2, 8, 3, 7, 4, 6, 5, 0, 70, 69, 68, 67, 66, 65, 1, 9, 2, 8, 3, 7, 4, 6, 5, 0, 70, 69, 68, 67, 66, 65, 1, 9, 2, 8, 3, 7, 4, 6, 5, 0, 70, 69, 68, 67, 66, 65
DATA_LEN equ $ - DATA
section .bss
@phoemur
phoemur / tictactoe.rs
Created October 12, 2025 21:08
tictactoe
use std::io;
use itertools::interleave;
type Board = [[char; 3]; 3];
fn main() {
let mut array: Board = [[' '; 3]; 3];
instructions();
println!("--------------------\n");