Skip to content

Instantly share code, notes, and snippets.

View HamedFathi's full-sized avatar
🌎

Hamed Fathi HamedFathi

🌎
View GitHub Profile
// Motivation: https://github.com/angular/angular/issues/18877

import { Directive, ElementRef, AfterViewInit } from '@angular/core';

@Directive({
  standalone: true,
  selector: '[remove-host]'
})
export class RemoveHostDirective implements AfterViewInit {
class PathMe {
moves: string[] = [];
constructor() {
this.moves = [];
return this;
}
moveTo(x: number, y: number) {
@HamedFathi
HamedFathi / download-install-wsl-linux.txt
Created December 6, 2023 08:30 — forked from vheidari/download-install-wsl-linux.txt
how to download and install manually wsl2, and linux distor on windows
Manually download Windows Subsystem for Linux distro packages:
# @link: https://docs.microsoft.com/en-us/windows/wsl/install-manual#installing-your-distro
Windows Subsystem for Linux Installation Guide for Windows 10:
# @link: https://docs.microsoft.com/en-us/windows/wsl/install-win10#set-your-distribution-version-to-wsl-1-or-wsl-2
Updating Wsl :
Download Msi Wsl update package from below link then install it :
@link : https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
@HamedFathi
HamedFathi / split_text.py
Created June 7, 2025 13:45 — forked from sudoaza/split_text.py
Recursive text splitter, because Langchain's one sucks!
def split_text(text, chunk_size=500, separators=['\n\n', '.\n', ':\n', '\n', '. ', ', ', " ", ""]):
"""Split text into chunks of size less than chunk_size, using separators."""
chunks = []
current_separator_index = 0
for separator in separators:
current_separator_index += 1
if len(text) < chunk_size:
if len(text) > 0:
chunks.append(text)