Skip to content

Instantly share code, notes, and snippets.

View gramos93's full-sized avatar
๐Ÿ˜†

Gabriel Ramos gramos93

๐Ÿ˜†
View GitHub Profile
@gramos93
gramos93 / autoexec.cfg
Last active September 7, 2025 14:12
CS2 Config as AutoExec
// Launch Options
// +exec autoexec.cfg -novid -high +cl_forcepreload 1
//Movement Keys
exec movement.cfg
// Crosshair
exec crosshair.cfg
donk // set crosshair to donk
@gramos93
gramos93 / template.c
Created February 9, 2025 21:58
C template for Leetcode questions
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define MAX_INPUT_SIZE 1000 // Adjust as needed
#define MAX_ARRAY_SIZE 1000
// Fast input handling
@gramos93
gramos93 / week_report.sh
Created July 29, 2024 19:24
Weekly Uptime Summary
#!/bin/bash
# Function to parse boot and shutdown times and calculate uptime for each session
calculate_daily_uptime() {
header_skipped=false
journalctl --list-boots --reverse | while read -r line; do
if [[ "$header_skipped" = false ]]; then
header_skipped=true
continue
fi
@gramos93
gramos93 / sliding.py
Last active July 2, 2024 13:30
Simple sliding window iterator in python
def sliding_slices(size: int, kernel: int, stride: Optional[int] = None) -> slice:
"""sliding_slices.
Args:
size (int): Max size of the conteiner.
kernel (int): Sliding window size.
stride (Optional[int]): Stride of the kernel.
Returns:
slice: Slided slice.
Note: If the size is not perfectly divisible by the kernel size, the
last slice will be corrected to finish perfectly on the size value.