Skip to content

Instantly share code, notes, and snippets.

View HusseinLezzaik's full-sized avatar
💫
dreaming

Hussein Lezzaik HusseinLezzaik

💫
dreaming
View GitHub Profile
@HusseinLezzaik
HusseinLezzaik / sync.sh
Created January 28, 2023 02:27
Bash script to automatically commit and push local changes
#!/bin/bash
gstatus=`git status --porcelain`
if [ ${#gstatus} -ne 0 ]
then
git add --all
git commit -m "Automated sync: $gstatus"
git pull --rebase
@HusseinLezzaik
HusseinLezzaik / estimatePiiMonteCarlo.py
Created February 17, 2023 01:30
Code to estimate pii numerically using Monte Carlo simulation
import random
# Set the number of points to generate
num_points = 1000000 # 10^6
# Initialize the counters for points inside and outside the circle
inside_circle = 0
outside_circle = 0
# Generate random points and count the number inside/outside the circle
@HusseinLezzaik
HusseinLezzaik / agent.py
Created February 23, 2023 01:45 — forked from wiseman/agent.py
Langchain example: self-debugging
from io import StringIO
import sys
from typing import Dict, Optional
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents.tools import Tool
from langchain.llms import OpenAI
@HusseinLezzaik
HusseinLezzaik / vscode-productivity.md
Last active August 7, 2023 14:42
VSCode keyboard tips and tricks :)

Shortcuts

  • Create Snippets for repetitive code, or use available extensions
  • Create directories from VSCode GUI
  • If you want to rename something, right click and select “Find All References” and then use “Rename Symbol” option
  • Command Palette gives you all the power of the keyboard without having to memorize them
    $ CTRL + P // opens command palette, by default search for scripts to open
    $ CTRL + P + “>” // access to open any command in vscode along with commands from extensions ex toggle mini map
    $ CTRL + P + “@“ // symbols search; for whole codebase use #TargetSymbol or #TSA for T…S..A…
    $ CTRL + SHIFT + “.” // symbols search inside file itself
    $ CTRL + G + “:NN” // Go to line NN; use “⬅️” or “➡️“ for character by character, or “CTRL + arrows” for word by word
@HusseinLezzaik
HusseinLezzaik / MicroDSA.md
Last active July 16, 2023 00:54
Minimal datastructures and algorithms reference
@HusseinLezzaik
HusseinLezzaik / Coding-Interviews.md
Created July 15, 2023 22:16
coding interview resrouces
@HusseinLezzaik
HusseinLezzaik / minimal-python.py
Last active July 15, 2023 22:24
python stuff
## Pip
```python
$ pip install package_name==required_version
$ pip uninstall package_name
```
## Install via Brew
```python
$ brew install [email protected]
```