Skip to content

Instantly share code, notes, and snippets.

View ourway's full-sized avatar
🏆

Farshid Ashouri ourway

🏆
View GitHub Profile
@ourway
ourway / shard_finder.py
Created March 12, 2023 09:40
Find the shard_number based on the key
import hashlib
# Get user input
key = input("Enter key: ")
num_shards = int(input("Enter number of shard databases: "))
# Hash the key
hashed_key = hashlib.sha256(key.encode()).hexdigest()
# Convert the hash to an integer
@ourway
ourway / 2023-03-10_-_Worker_and_Temporary_Worker.csv
Created March 10, 2023 23:32
skilled worker visa license holders in London
We can't make this file beautiful and searchable because it's too large.
"@ Home Accommodation Services Ltd","London",,"Worker (A rating)","Skilled Worker"
"001 Times Ltd","London",,"Worker (A rating)","Skilled Worker"
"01 ACCOUNTING SERVICES LTD","LONDON",,"Worker (A rating)","Skilled Worker"
"012 Global Ltd","London",,"Worker (A rating)","Skilled Worker"
"0xA Technologies Ltd","London",,"Worker (A rating)","Skilled Worker"
"100 SHAPES LTD","LONDON",,"Worker (A rating)","Skilled Worker"
"1000heads Ltd","London",,"Worker (A rating)","Skilled Worker"
"100Starlings Ltd","London",,"Worker (A rating)","Skilled Worker"
"101 Ways Limited","London",,"Worker (A rating)","Skilled Worker"
"10BE5 LTD.","London",,"Worker (A rating)","Skilled Worker"
We can't make this file beautiful and searchable because it's too large.
" VENISHAAN SERVICES LTD","Dorking",,"Worker (A rating)","Skilled Worker"
"*ABOUTCARE HASTINGS LTD","East Sussex",,"Worker (A rating)","Skilled Worker"
"???£ ESS LTD","Manchester",,"Worker (A rating)","Skilled Worker"
"@ Architect UK Ltd","West Horndon","Essex","Worker (A rating)","Skilled Worker"
"@ Home Accommodation Services Ltd","London",,"Worker (A rating)","Skilled Worker"
"@ Tech Software Ltd","Maidstone",,"Worker (A rating)","Skilled Worker"
"[AI] INFINITI LIMITED","Croydon","England","Worker (A rating)","Skilled Worker"
"+Plus Care Ltd","Manchester",,"Worker (A rating)","Skilled Worker"
"001 Times Ltd","London",,"Worker (A rating)","Skilled Worker"
"003 Ltd","Hounslow",,"Worker (A rating)","Skilled Worker"
ack
aom
aribb24
asciinema
autossh
awscli
bash
bat
bdw-gc
berkeley-db
@ourway
ourway / brew-list.txt
Last active March 9, 2023 19:35
Brew installed packages
ack
aom
aribb24
asciinema
autossh
awscli
bash
bat
bdw-gc
berkeley-db
--[[
lvim is the global options object
Linters should be
filled in as strings with either
a global executable or a path to
an executable
]]
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
set editing-mode vi
# vi settings
$if mode=vi
set keymap vi-insert
"kj" # remap escape
$endif
@ourway
ourway / shortest_path_1.py
Created January 22, 2023 20:20
Here is an example of a Python program that calculates the shortest route between two points using the Dijkstra algorithm
import heapq
def shortest_route(start, end, graph):
# Initialize the heap with the starting point
heap = [(0, start)]
# Initialize a dictionary to keep track of the best distances to each point
best_distances = {start: 0}
# Initialize a dictionary to keep track of the previous point in the best route to each point
previous_points = {}
#!/bin/bash
# Kill all running containers.
docker kill $(docker ps -q)
# Delete all stopped containers.
printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)
# Delete all untagged images.
@ourway
ourway / foo.vim
Created December 5, 2022 04:28
my latest vimrc file - Dec 2022
" 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