Skip to content

Instantly share code, notes, and snippets.

View rooooop5's full-sized avatar
🎯
Focusing

rooooop5

🎯
Focusing
View GitHub Profile
@rooooop5
rooooop5 / time.c
Created April 5, 2026 16:38
a time to string converter
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
#include <string.h>
#define TIMESTAMP_FORMAT "%Y-%m-%d %H:%M:%S"
char* str_contructor(char* args[]);
char* timestamp()
@rooooop5
rooooop5 / string_constructor.c
Created April 5, 2026 16:33
a string constructor using appending using C
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>
#define TRASH_DIR "/deleted"
#define PATH_LEN 200
#define CONCATENATE_BUFFER_LEN 100
@rooooop5
rooooop5 / trash.c
Created April 5, 2026 16:32
A terminal trash implementation using rename()
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define CLOCK_MAX 50000
#define MAX 20000
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFFER_SIZE 1024
#define WORD_SIZE 5
char* get_input(void)
{
char c;
char* buffer;
buffer=(char*)malloc(BUFFER_SIZE*sizeof(char));