Skip to content

Instantly share code, notes, and snippets.

View outlinepix's full-sized avatar
🎯
Focusing

Viraat Maurya outlinepix

🎯
Focusing
View GitHub Profile
@outlinepix
outlinepix / Selection-sort-in-c-language.c
Created January 15, 2023 15:37
Selection sort implementation in c language (Snobbish)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
/* uncomment line below if need to see debug info */
/* #define DEBUG */
void selectionSort(int numbers[], int length);
int main(int argc, char *argv[])
@outlinepix
outlinepix / fastHasher.py
Created September 17, 2022 13:05
EVIL ZONE Programming Challenge : fastHasher | In Python3 and Bash Script. Noobish implementation
#COPY BASH SCRIPT FROM END OF FILE TO MAKE THIS PYTHON SCRIPT WORK PROPERLY.
# Also update cokie and session Id in Header
import requests
import subprocess
import re
import base64
from bs4 import BeautifulSoup
url = 'https://evilzone.org/challenges/fast_hasher/'
@outlinepix
outlinepix / unpacker.sh
Created September 14, 2022 10:03
Evilzone.org | Programming Challenge | Challenge: Unpacker
#Dowload the archive file from : https://evilzone.org/index.php?page=challenges&sub=viewChallenge&id=21
#Run ./unpacker.sh script from the location you downloaded file.
#!/usr/bin/env bash
FILE=$(pwd)
FILE+=/flag_999.tar.gz
if test -f "$FILE"; then
echo "File found and Procesing."
else
echo "File $FILE does not exist."
@outlinepix
outlinepix / bubble_sort_LinkedList.c
Created August 17, 2022 08:36
Bubble sort on Linked List by values in C language.
/* full implimentationof Linked List : https://github.com/outlinepix/LinkedList */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
typedef struct Node
{
int data;
struct Node *next;
@outlinepix
outlinepix / Binary_search_in_c_using_recursion.
Created August 15, 2022 15:49
Binary search for list of integers in C using recursion .
#include <stdio.h>
int binarySearch(int[], int, int, int);
int main()
{
/* Basic condition for binary search is list must be sorted or you have some kinda machanism to sort it */
int array[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
int length = sizeof(array) / sizeof(array[0]);
int target = 30;
@outlinepix
outlinepix / list.c
Created August 10, 2022 08:55
python like implementation of list in C language.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
typedef struct
{
char **list;
int length;
} stringList;
@outlinepix
outlinepix / slice.c
Created August 8, 2022 10:28
slice() function to slice character from word and return new sliced word in C language.
void *slice(void *, int); /*prototype*/
void *slice(void __restricted *ptr, const int size)
{
char* newPtr = (char*)malloc(size);
memcpy(newPtr, ptr, size);
return newPtr;
}
@outlinepix
outlinepix / C language of index0f() function of javascript.c
Last active August 8, 2022 10:54
C language of index0f() function of javascript.
int indexOf(void *word, void *chars)
{
char *result = strstr(word, chars);
if (result == NULL)
{
printf("%s\n", "Not found");
return -1;
}
char *p = word;
@outlinepix
outlinepix / Best sum for coin change problem in C.
Created August 7, 2022 12:48
Best sum for coin change problem in C.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#define MAX_LEN 10
size_t count = 0, i = 0;
void appendToArray(int *array, int len, int value);
int cmp(const void *a, const void *b);
@outlinepix
outlinepix / Compare function for qsort() in C language.
Last active August 7, 2022 12:00
Compare function for qsort() in C language. ( Both Ascending and descending order output)
/* IF YOU WANT TO SORT IN DESCENDING ORDER */
int cmp(const void *a, const void *b)
{
const int *A = a, *B = b;
/* a>b => -1, a<b => 1, a==b => 0 */
return (*A < *B) - (*A > *B);
}
/* FOR ASCENDING ORDER SORT*/
int cmp(const void *a, const void *b)