Skip to content

Instantly share code, notes, and snippets.

View san-ghun's full-sized avatar
< wtf ./engage --keep-calm --enjoy >> Stronger

Sanghun Park san-ghun

< wtf ./engage --keep-calm --enjoy >> Stronger
View GitHub Profile
@san-ghun
san-ghun / permutations-malloc.c
Created October 28, 2024 21:43
Permutations generator with malloc in C
#include <unistd.h>
#include <stdlib.h>
char **perms; // Dynamic array to store permutations
int perm_count = 0;
int str_len;
void swap(char *a, char *b)
{
char t = *a;
@san-ghun
san-ghun / permutations-fixed.c
Last active October 28, 2024 21:42
Permutations generator in C
#include <unistd.h>
#include <stdlib.h>
#define MAX_LEN 10
#define MAX_PERM 3628800 // 10!
char perms[MAX_PERM][MAX_LEN]; // Array to store all permutations
int perm_count = 0;
void swap(char *a, char *b)
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
// Function to write an error message to stderr
void err(char *str)
{
// Loop through each character in the string and write it to stderr
while (*str)
@san-ghun
san-ghun / git-commit-template.md
Created October 16, 2024 18:51 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@san-ghun
san-ghun / README.md
Created October 16, 2024 18:49 — forked from akashnimare/README.md
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status

@san-ghun
san-ghun / ft_printf_lite.c
Created February 8, 2024 23:57
ft_printf lite version to prepare for exam 42
#include <limits.h>
#include <unistd.h>
#include <stdarg.h>
int ft_putchar(char c)
{
return (write(1, &c, 1));
}
int ft_putstr(char *s)
@san-ghun
san-ghun / Homoglyphs.md
Created January 25, 2023 21:52 — forked from StevenACoffman/Homoglyphs.md
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ