Skip to content

Instantly share code, notes, and snippets.

@Om-Kamath
Om-Kamath / main.py
Created June 23, 2024 06:10
Mesop Tutorial
# To run command: mesop main.py
import mesop as me
import google.generativeai as genai
import json
import typing_extensions
@me.stateclass
class Article:
title: str
@gowhari
gowhari / vigenere-cipher.py
Created May 23, 2018 10:24
vigenere cipher
# encoding: utf8
# vigenere cipher
# https://stackoverflow.com/a/2490718/1675586
def encode(key, string):
encoded_chars = []
for i in range(len(string)):
key_c = key[i % len(key)]
encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
encoded_chars.append(encoded_c)