Skip to content

Instantly share code, notes, and snippets.

View kasir-barati's full-sized avatar
Dedicated to achieve his goals

Mohammad Jawad (Kasir) Barati kasir-barati

Dedicated to achieve his goals
View GitHub Profile
@kasir-barati
kasir-barati / portfolio-rebalancer.workflow.json
Last active August 7, 2026 15:39
Limitations of n8n AI Agents & Tools
{
"name": "Stock Portfolio Agent",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 12 * * 1-5"
@kasir-barati
kasir-barati / local-llm.md
Last active July 31, 2026 10:22
Local LLM

Ollama exposes an OpenAI-compatible API on port 11434, so most OpenAI-compatible tools can talk to it by simply changing the base URL. I am gonna try Qwen3-Coder 14B, light enough for a much nicer developer experience while still having enough resources left for Docker, VS Code, PostgreSQL, browsers, etc.

Ollama supports OpenAI-style /v1/chat/completions, you can test it:

curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-coder:14b",
 "messages": [
@kasir-barati
kasir-barati / README.md
Created July 29, 2026 15:33
Cheat wheelofnames
@kasir-barati
kasir-barati / index.html
Created November 24, 2024 13:44
A simple demonstration of ExpressJS + CORS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
fetch("http://localhost:3000", {
@kasir-barati
kasir-barati / keyboard-layout
Created August 25, 2022 07:31
Add keyboard change layout. Currently just English to Persian
#!/bin/bash
setxkbmap -layout us,ir
setxkbmap -option 'grp:alt_shift_toggle'
@kasir-barati
kasir-barati / manjaro-apps
Last active August 25, 2022 09:51
My bash script to install necessary apps in Manjaro
# Upgrade and update
sudo pacman -Syu --noconfirm
# Install Git and config it
sudo pacman -S git
git config --global init.defaultBranch main
git config --global user.name "Kasir Barati"
git config --global user.email "kasir.barati@gmail.com"
@kasir-barati
kasir-barati / js-to-py.md
Last active July 1, 2022 04:36
A simple gist full of syntax translation between two God, JS and Python

comprehensions

const arr = [1,2,3];
arr.map(x => 2*x);
arr.filter(x => x % 2 == 0);
arr = [1,2,3]
[2*x for x in arr]
@kasir-barati
kasir-barati / vimrc
Created June 21, 2022 06:27
My customization for vim.
" set autoindent
" reload files when changed on disk, i.e. via `git checkout`
set autoread
" Fix broken backspace in some setups
set backspace=2
" see :help crontab
set backupcopy=yes
" yank and paste with the system clipboard
set clipboard=unnamed
" don't store swapfiles in the current directory
@kasir-barati
kasir-barati / README.md
Last active June 20, 2022 14:50
A simple script to emerges environment.ts file from .env file for an Angular app.

Some good notes:

  • With Angular you can store those information in the environment.ts files, but you need to commit them in the repository, and again, this is not what we want. If something is changing, you need to update them and in an Agile environment, you also need to pass Code Review, Test and many other steps to certify a “Done” ticket.
  • Keep in mind that in a Front End world, it is pretty much impossible to keep anything hidden from the final user (the code can always be inspected in any browser). For this reason, the use of secret keys and passwords in this world have to be considered very carefully and under a secure structure managed backend side.

Important possible improvements:

Please note that this script disclose too much data. You can filter them by using filter-env lib. In that case you can add a specific prefix to all of your envs. The other point is that this script uses the same env name as it is inside the .env file, so my suggestion to