Skip to content

Instantly share code, notes, and snippets.

View mahanmarwat's full-sized avatar
🤍
Free

Mahan Marwat mahanmarwat

🤍
Free
View GitHub Profile
@mahanmarwat
mahanmarwat / main.dart
Created February 5, 2022 21:47
How to stretch this equal button in flutter?
import "package:flutter/material.dart";
class MainScreen extends StatefulWidget {
@override
State<MainScreen> createState() => _MainScreenState();
}
class _MainScreenState extends State<MainScreen> {
TextEditingController input_controller = TextEditingController();
var input_value = "";
@mahanmarwat
mahanmarwat / celo_address.txt
Created February 3, 2022 18:57
Celo Gist For Bounty
0x315C7439Fdb8c2934860C2Ac978382f0DD38B64e
@mahanmarwat
mahanmarwat / Caesar Cipher.py
Created October 27, 2015 08:37
Caesar Cipher with key support.
"""Substitution cypher, Ceasar's Cipher"""
from __future__ import print_function
import sys
MIN = 97
MAX = 122
def encode(text, n):
"""Encode the text.
@mahanmarwat
mahanmarwat / find_match.py
Last active October 27, 2015 10:20
Search for user input in a list of lines (created from file).
def find_match(keys_file, values_file, user_input):
keys = []
values = []
with open(keys_file) as k_handler, open(values_file) as v_handler:
keys = [line.rstrip('\n') for line in k_handler]
values = [line.rstrip('\n') for line in v_handler]
is_found = False
if keys and values:
try:
# insure keys are lowercase.
from collections import Counter
import random
def base_strategy():
return random.randrange(1, 10)
def computer_strategy(scores, player_answers, computer_answers,
@mahanmarwat
mahanmarwat / Burglar.py
Last active August 29, 2015 14:05
Solution to "picking the most valueable things" problem.
# Python 3.4
# Author: Mahan Marwat
from itertools import combinations
items = {'Clock': [175, 10],
'Painting': [90, 9],
'Radio': [20, 4],
'Vase': [50, 2],
'Book': [10, 1],
@mahanmarwat
mahanmarwat / Pass Cracker.py
Last active October 10, 2016 17:34
Dictionary attack based password cracker.
"""
"42","deleted","9bd4d2724d163588e2ab6460ec111c63","deleted","deleted","1","someone@server.com","TZ851BASC9J5543U15T34Z","6eb8977fa505b44099017213d8f3714fd38a7816","0","0","deleted","7c5494c5f4203654","1385366270","1401585007","0","0",NULL
hash_ # 2
salt # 12
How it works:
There is a file in which there is users data. In this user data all of the
information is present to get a password. i.e pass hash, salt etc look to
the abouve line.