Skip to content

Instantly share code, notes, and snippets.

View halloweeks's full-sized avatar
💭
I may be slow to respond.

Hallo Weeks halloweeks

💭
I may be slow to respond.
View GitHub Profile
@halloweeks
halloweeks / main.cpp
Last active January 16, 2023 12:49
c++ url decoder
#include <iostream>
#include <stdlib.h>
#include <string>
std::string url_decode(char *url) {
std::string temp, output;
char ch;
for (unsigned int index = 0; index < strlen(url)+1; index++) {
if (url[index] == '%') {
temp += url[index+1];
@halloweeks
halloweeks / mysql.c
Created November 15, 2022 10:49
MySQL connection with c language
#include <stdio.h>
#include <stdlib.h>
#include <mariadb/mysql.h>
int main() {
MYSQL *connection;
MYSQL_RES *results;
MYSQL_ROW row;
connection = mysql_init(NULL);
@halloweeks
halloweeks / log.txt
Last active May 13, 2024 03:02
c++ zlib compress decompress string
# compile
g++ zlib.cpp -o zz -lz
# run
root@localhost:~# ./zz
Orignal string size: 43
Original string: halloweeks halloweeks halloweeks halloweeks
--------------------
Compressed string size: 22