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 / 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 / polars.md
Last active November 11, 2024 16:57
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 September 30, 2024 06:55
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 / .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');
@bitsnaps
bitsnaps / finetune_llama_v2.py
Created April 16, 2024 18:01 — forked from younesbelkada/finetune_llama_v2.py
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@bitsnaps
bitsnaps / OAI_CONFIG_LIST
Created January 7, 2024 18:28 — forked from langecrew/OAI_CONFIG_LIST
Taking the Autogen Teachable Agent one step further with some customization
[
{
"model": "gpt-4",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
"model": "gpt-4-1106-preview",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
@bitsnaps
bitsnaps / gptq_lora.py
Created December 19, 2023 18:35 — forked from datasciencemonkey/gptq_lora.py
train a gptq model using peft/lora
# %%
# this is run from /notebooks on paperspace
from huggingface_hub import login
from dotenv import load_dotenv
load_dotenv("/notebooks/.env")
import os
os.environ["TOKENIZERS_PARALLELISM"]="false"
login(token=os.getenv("HUGGINGFACE_TOKEN"))
1. Install oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
2. Clone necessary plugins.
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
3. Add plugins to ~/.zshrc as
plugins = ( [plugins...] zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting)