Skip to content

Instantly share code, notes, and snippets.

View ourway's full-sized avatar
🏆

Farshid Ashouri ourway

🏆
View GitHub Profile
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
unbind C-b
set -g prefix C-a
bind-key C-a last-window
@ourway
ourway / vim.py
Created May 20, 2025 20:26
Simple Vim Implementation in Python
import curses
import os
import sys
# Modes
NORMAL_MODE = 0
INSERT_MODE = 1
COMMAND_MODE = 2
class PyVim:
import json
class IcebergSchemaFlattener:
def __init__(self):
self.flattened_fields = []
def flatten_schema(self, columns):
for column in columns:
self._process_column(column, parent_path=[])
We couldn’t find that file to show.
-----BEGIN CERTIFICATE-----
MIIEBTCCAu2gAwIBAgIUYem6IP2M6fawN09msj1M3/PgIx8wDQYJKoZIhvcNAQEL
BQAwgZExCzAJBgNVBAYTAkdCMRAwDgYDVQQIDAdFbmdsYW5kMQ8wDQYDVQQHDAZM
b25kb24xDTALBgNVBAoMBEpQTUMxDDAKBgNVBAsMA0lDQjEVMBMGA1UEAwwManBt
Y2hhc2UuY29tMSswKQYJKoZIhvcNAQkBFhxmYXJzaGlkLmFzaG91cmlAanBtb3Jn
YW4uY29tMB4XDTI1MDIyMzAyMjcwM1oXDTI2MDIyMzAyMjcwM1owgZExCzAJBgNV
BAYTAkdCMRAwDgYDVQQIDAdFbmdsYW5kMQ8wDQYDVQQHDAZMb25kb24xDTALBgNV
BAoMBEpQTUMxDDAKBgNVBAsMA0lDQjEVMBMGA1UEAwwManBtY2hhc2UuY29tMSsw
KQYJKoZIhvcNAQkBFhxmYXJzaGlkLmFzaG91cmlAanBtb3JnYW4uY29tMIIBIjAN
BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw+IOl00NNUTFK8ppfkpfX3+/7BFQ
{
"schemas": [
{
"group": "admin",
"schema": "core_banking",
"owner": true
},
{
"group": "silver_access",
"schema": "core_banking",
"""
PROCESS EXPLANATION:
--------------------
1. The `PackageGenerator` creates new packages and sends them to the `DeliveryManager`.
2. The `DeliveryManager` receives new packages and then checks if there are available `Deliverer` workers.
3. The `Deliverer` workers pick up packages, attempt to deliver them, and report back success or failure.
4. When a package delivery fails, it is re-inserted into the front of the queue by the `DeliveryManager`.
5. The system continues until the package queue is empty, all packages are delivered, and the generator
has signaled that it is done generating packages.
6. The `DeliveryManager` provides a condition variable (`cv`) to wait until all packages are delivered.
import random
class EndToEndEncryption:
"""
A simplified End-to-End Encryption example with Diffie-Hellman key exchange and a
basic keystream-based XOR encryption.
This class includes:
1. Prime number generation for Diffie-Hellman parameters.
@ourway
ourway / Makefile
Last active June 24, 2024 00:55
Content of Makefile
# Variables
PYTHON = python3.12
VENV = .venv
PIP = $(VENV)/bin/pip
PYTHON_BIN = $(VENV)/bin/python
ISORT = $(VENV)/bin/isort
BLACK = $(VENV)/bin/black
MYPY = $(VENV)/bin/mypy
PYTEST = $(VENV)/bin/pytest
@ourway
ourway / Makefile
Created June 24, 2024 00:19
Content of Makefile
# Variables
PYTHON = python3.12
VENV = .venv
PIP = $(VENV)/bin/pip
PYTHON_BIN = $(VENV)/bin/python
ISORT = $(VENV)/bin/isort
BLACK = $(VENV)/bin/black
MYPY = $(VENV)/bin/mypy
PYTEST = $(VENV)/bin/pytest