Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Ztuu's full-sized avatar
👾
Not committing to master

Stuart Ztuu

👾
Not committing to master
View GitHub Profile
@Ztuu
Ztuu / disemvowel.c
Created June 30, 2020 08:24
Remove vowels from a string
#include <stdio.h>
#include <string.h>
char *disemvowel(const char *str)
{
char* result = malloc(strlen(str) + 1);
char vowels[] = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'};
int counter = 0;
while(*(str) != '\0'){
@Ztuu
Ztuu / mdb_date_query.py
Created June 29, 2020 07:21
Pymongo: $match on only date portion of datetime Mongodb
import pymongo
from datetime import date
# TODO: Add your connection string, database name and collection name below
my_client = pymongo.MongoClient("...")
my_db = my_client["..."]
my_collection = my_db["..."]
def filter_by_date(query_date):
@Ztuu
Ztuu / rot13.c
Last active October 11, 2023 08:18
ROT13 Function in C
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
ROT13 is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet.
ROT13 is an example of the Caesar cipher.
This function takes a string and returns the string ciphered with Rot13.