Skip to content

Instantly share code, notes, and snippets.

View bitsnaps's full-sized avatar
🌍
Working @ CorpoSense

Ibrahim H. bitsnaps

🌍
Working @ CorpoSense
View GitHub Profile
@bitsnaps
bitsnaps / bootstrap5.md
Last active May 8, 2025 15:20
A cheat sheet for Bootstrap 5

Bootstrap v5 Cheat Sheet:

This cheat sheet provides a comprehensive overview of the Bootstrap v5 CSS framework, including its layout system, typography, colors, components, utilities, JavaScript plugins, customization options, accessibility considerations, responsive utilities, and RTL support.

It also demonstrates with some code usage examples how to use various features in your HTML and CSS code.

1. Layout

  • Container: .container, .container-fluid, .container-{breakpoint}
  • Grid system: .row, .col, .col-{breakpoint}-{size}
  • Responsive breakpoints: sm, md, lg, xl, xxl
@bitsnaps
bitsnaps / polars.md
Last active April 6, 2025 02:21
A cheat sheet for polars python package

Polars Cheat Sheet

Here's a cheat sheet for the Polars Python package, covering many of its key functions and features:

Installation

pip install polars 

# Install Polars with all optional dependencies:
pip install 'polars[all]'
@bitsnaps
bitsnaps / query_llm.py
Last active February 1, 2025 10:20
This python demo is designed to query any LLM provider using the chat completion OpenAI API using only http requests, all you have to do is to provide the `.env` from your user home or the current running directory, you can set your own default values to override default ones
import os
import requests
import logging
from pathlib import Path
from dotenv import load_dotenv
from typing import Optional
#from openai import OpenAI # You don't need it here
# Predefined constants
#OPENAI_BASE_URL = "https://api.openai.com/v1/"
@bitsnaps
bitsnaps / codemirror-cdn.html
Created November 3, 2024 09:40 — forked from esironal/codemirror-cdn.html
Codemirror CDN
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Code Mirror CDN</title>
<link rel="stylesheet" href="http://esironal.github.io/cmtouch/lib/codemirror.css">
@bitsnaps
bitsnaps / index.html
Created October 8, 2024 09:22
Showcase examples to File System Access API (created by claude-3.5-sonnet) working on Chrome v109.x
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File System Access API Demo</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
@bitsnaps
bitsnaps / gist_to_github_repo.md
Last active August 18, 2024 09:14 — forked from ishu3101/gist_to_github_repo.md
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@bitsnaps
bitsnaps / dataframe_viewer.py
Created June 25, 2023 18:09
A simple Qt5 python app to display a CSV or Excel in TableWidget
# pip install openpyxl, pandas, PyQt5... (if you don't use conda)
import sys
import pandas as pd
from PyQt5.QtCore import QSize, Qt, pyqtSlot, pyqtSignal
from PyQt5.QtWidgets import (QApplication, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem,
QFileDialog, QVBoxLayout, QWidget, QDialog, QLabel, QLineEdit, QComboBox, QCheckBox, QHBoxLayout)
# Custom TableWidget class
class TableWidget(QTableWidget):
def __init__(self, df, parent=None):
@bitsnaps
bitsnaps / ZipUnzip.groovy
Last active June 16, 2024 01:14
Zip and UnZip files using Groovy
import java.util.zip.*
String zipFileName = "file.zip"
String inputDir = "logs"
def outputDir = "zip"
//Zip files
ZipOutputStream zipFile = new ZipOutputStream(new FileOutputStream(zipFileName))
new File(inputDir).eachFile() { file ->
@bitsnaps
bitsnaps / .block
Created May 12, 2024 11:41 — forked from domoritz/.block
Vega Bl.ocks example
license: bsd-3-clause
@bitsnaps
bitsnaps / findRec.js
Last active May 10, 2024 13:51
Find the most recent version of any given Node package by looking at every package.json file recursively in the current directory, I used this in order to detect the most recent version before downloading a new one instead of using `--prefer-offline` installation. It works offline.
#!/usr/bin/env node
/**
* This script finds the most recent installed version of any given Node package.
* Simple usage:
* node findRec.js vue [/path/to/projects]
*/
const fs = require('fs');
const os = require('os');
const path = require('path');