Skip to content

Instantly share code, notes, and snippets.

@CGrive
CGrive / remove_background.py
Created January 3, 2026 20:00
A simple python program to remove background from images...
# Make sure to install these depdencies first!!!
from rembg import remove
from PIL import Image
import io
def remove_background(input_image_path, output_image_path):
with open(input_image_path, 'rb') as input_file:
input_image = input_file.read()
@CGrive
CGrive / UrlShortener.py
Created February 14, 2024 11:55
A simple Url shortener with GUI
import tkinter as tk
import pyperclip as clipboard
from PIL import ImageTk,Image
import pyshorteners
def short():
s = pyshorteners.Shortener()
short_url = s.tinyurl.short(url.get())
url.set(short_url)
@CGrive
CGrive / TicTacToe.cpp
Last active January 16, 2025 10:07
C++ program for TicTacToe Game in CLI
#include <cstdlib>
#include<iostream>
#include <string>
class XnO{
protected:
char game_board[3][3];
public:
// Function declaration
XnO(){
@CGrive
CGrive / c++.code-snippet
Last active December 28, 2023 09:35
vs code snippet for C++
{
// Place your Cpp workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
"basic syntax": {
"scope": "cpp",
@CGrive
CGrive / site.webmanifest
Created November 23, 2023 06:10
Simple Snippet for site.webmanifest
{
"name":"App name",
"short_name":"App name",
"icons":
[
{"src":"images/logo192.png","sizes":"192x192","type":"image/png"},
{"src":"images/logo96.png","sizes":"96x96","type":"image/png"},
{"src":"images/logo168.png","sizes":"168x168","type":"image/png"}
],
"theme_color":"#cc0000",