Skip to content

Instantly share code, notes, and snippets.

View ourway's full-sized avatar
🏆

Farshid Ashouri ourway

🏆
View GitHub Profile
{
"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
from selenium.common.exceptions import NoSuchElementException, ElementClickInterceptedException
from selenium import webdriver
import time
import pandas as pd
def get_jobs(keyword, num_jobs, verbose):
'''Gathers jobs as a dataframe, scraped from Glassdoor'''
# Initializing the webdriver
@ourway
ourway / pandas cheat sheet.md
Created April 20, 2023 16:09 — forked from fabsta/pandas cheat sheet.md
pandas cheat sheet

[TOC]

Preliminaries/Import

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import DataFrame, Series
" Helps force plugins to load correctly when it is turned back on below
filetype off
" Install vim plug if not installed
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Helps force plugins to load correctly when it is turned back on below
filetype off
" Install vim plug if not installed
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
defmodule GFLOPS do
def calculate do
num_iterations = 1_000_000_000
start_time = :erlang.monotonic_time()
for _ <- 1..num_iterations do
# Perform a double-precision floating point operation
_ = 1.0 + 1.0
end
end_time = :erlang.monotonic_time()