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 / polars.md
Last active May 8, 2026 14:50
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 / bootstrap5.md
Last active March 3, 2026 12:41
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 / curl-hack-.md
Last active January 7, 2026 01:27 — forked from lemajes/curl-hack-.md
Curl example #bash #curl #hack

Hacking With cURL

A list of examples and references of hacking with Bash and the Curl command.

What the heck is cURL?

cURL is short for "Client URL" and is a computer software project providing a library (libcurl) and command-line tool (curl) first released in 1997. It is a free client-side URL transfer library that supports the following protocols: Cookies, DICT, FTP, FTPS, Gopher, HTTP/1, HTTP/2, HTTP POST, HTTP PUT, HTTP proxy tunneling, HTTPS, IMAP, Kerberos, LDAP, POP3, RTSP, SCP, and SMTP Although attack proxies like BurpSuitePro are very handy tools, cURL allows you to get a bit closer to the protocol level, leverage bash scripting and provides a bit more flexibility when you are working on a complex vulnerability.

cURL GET parameters

HTTP GET variables can be set by adding them to the URL.

@bitsnaps
bitsnaps / HelloJNI.java
Last active June 3, 2025 10:54
Simple example using JNI with MinGW C++
import java.util.*;
class HelloJNI extends Hello {
static {
System.loadLibrary("HelloCpp"); // HelloCpp.dll (Windows) or libhellocpp.so (*nix)
}
//instance variable
private int number = 10;
@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 ->