Skip to content

Instantly share code, notes, and snippets.

View zubin-madon's full-sized avatar

Zubin Madon zubin-madon

View GitHub Profile
function WalletIndex(props) {
const [chosenName, setChosenName] = useState(props.wallets[0]);
const [chosenWallet, setChosenWallet] = useState(props.wallets[0].walletAddress)
console.log("index loaded " + chosenWallet)
async function showWalletHandler() {
setChosenWallet(chosenName.walletAddress)
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
# Default ignored files
/shelf/
/workspace.xml
@zubin-madon
zubin-madon / main.py
Created June 25, 2021 06:54
NATO phonetic alphabet
import pandas
df = pandas.read_csv('nato_phonetic_alphabet.csv')
keyword_dict = {row.letter:row.code for (index, row) in df.iterrows()}
print(keyword_dict)
running = True
while running:
user_word = input("Enter a word: ")
@zubin-madon
zubin-madon / hirst painting.py
Last active June 13, 2021 19:40
TurtleModule
# import colorgram
# colors = colorgram.extract('hirst_painting.jpg', 25)
# rgb_colors = []
# for color in colors:
# r = color.rgb.r
# g = color.rgb.g
# b = color.rgb.b
# new_color = (r, g, b)
# rgb_colors.append(new_color)
import turtle as t
@zubin-madon
zubin-madon / data.py
Created June 13, 2021 19:37
quizzbrain
question_data = [
{"text": "A slug's blood is green.", "answer": "True"},
{"text": "The loudest animal is the African Elephant.", "answer": "False"},
{"text": "Approximately one quarter of human bones are in the feet.", "answer": "True"},
{"text": "The total surface area of a human lungs is the size of a football pitch.", "answer": "True"},
{"text": "In West Virginia, USA, if you accidentally hit an animal with your car, "
"you are free to take it home to eat.", "answer": "True"},
{"text": "In London, UK, if you happen to die in the House of Parliament, "
"you are entitled to a state funeral.", "answer": "False"},
{"text": "It is illegal to pee in the Ocean in Portugal.", "answer": "True"},
@zubin-madon
zubin-madon / Excel Sheet
Created June 6, 2021 15:20
Retrieving data from an inventory and storing in dictionary
C:\Users\Zubin\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/Zubin/PycharmProjects/pythonProject/excel2.py
{'Liners': {'6" LINER CERAMIC NEW': 3, '6" LINER CERAMIC USED': 6, '5-1/2" LINER CERAMIC USED': 11, '5-1/2" LINER CERAMIC NEW': 1, '5" LINER METAL USED': 14, '5" LINER METAL NEW': 2}, 'Pistons': {'6" PISTON SWAB WHITE - NEW': '6B + 4W', '6" PISTON SWAB WHITE - USED': 4, '5-1/2" PISTON SWAB RED - NEW': 2, '5-1/2" PISTON SWAB WHITE - NEW': 2, '5" PISTON WAB RED - NEW': 4, '5" PISTON WAB RED - USED': 2, '5" PISTON WAB GREEN - USED': 5, '5" PISTON WAB BLUE & YELLOW - USED': 3}, 'Seats': {'SEAT NEW': 10, 'SEAT USED WITHOUT O-RING': 16, 'SEAT USED WITH O-RING': 2}, 'Rod': {}, 'Seat Puller': {'SEAT PULLER JACK': 3, 'SEAT PULLER JAW': 1, 'SEAT PULLER HYD PUMP': 1, 'SEAT PULLER THREADED ROD LONG': 1, 'SEAT PULLER THREADED ROD SHORT': 2, 'SEAT PULLER THREADED ROD LONG - BENT': 1, None: None, 'LINER CLAMP NEW': 2, 'MODULE THEREADED CAP NEW': 1, 'MODULE THEREADED CAP WITH FLANGE': 1, 'WEAR PLATE USE
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
should_continue = True
while should_continue:
direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n")
text = input("Type your message:\n").lower()
shift = int(input("Type the shift number:\n"))
#TODO-1: Create a function called 'encrypt' that takes the 'text' and 'shift' as inputs.
def caeser_cipher(direction,text,shift):