Skip to content

Instantly share code, notes, and snippets.

@sinabigo
sinabigo / messing_with_dropbox.py
Created November 28, 2021 04:35
message with dropbox python api client. Crappy python, my bad ## پیام با دراپ باکس
import asyncio
import aiohttp
from codetiming import Timer
import dropbox
import asyncio
import json
import logging
import os
import pathlib
@sinabigo
sinabigo / tetris.py
Created November 28, 2021 04:31
Tetris implementation in Python # پیاده سازی تتریس در پایتون
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# Very simple tetris implementation
#
# Control keys:
# Down - Drop stone faster
# Left/Right - Move stone
# Up - Rotate Stone clockwise
# Escape - Quit game
@sinabigo
sinabigo / com.apple.private.health.heart-rhythm.plist
Created November 28, 2021 04:29
Apple Watch ECG Activation Record ## فعال سازی ECG در‍‌ اپل واچ
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HKAtrialFibrillationDetectionOnboardingCompleted</key>
<integer>1</integer>
<key>HKElectrocardiogramOnboardingCompleted</key>
<integer>3</integer>
</dict>
</plist>
@sinabigo
sinabigo / test.py
Created November 28, 2021 04:27
any-amount-of-players number guessing game ## بازی حدس زدن تعداد بازیکنان
import random
max_score=100
max_scorer=""
while True:
print("Top score: %d by %s" % (max_score,max_scorer))
name = input("what’s your name?")
print("hello %s" % name)
answer = random.randint(1,100)
guess=0
@sinabigo
sinabigo / hangman_orig.py
Created November 28, 2021 04:23
another version of the hangman game in python ## بازی ساده حدس کلمه / پایتون ## بازی پایتون
import string
import random
from words_json import words
# randomly select word from words list
# don't allow words with spaces or dashes
def get_valid_word(words):
word = random.choice(words)
while ' ' in word or '-' in word:
word = random.choice(words)
@sinabigo
sinabigo / minecraft-chat-client.py
Created November 28, 2021 04:22
Basic minecraft chat client written in Python # کلاینت اصلی چت بازی ماینکرافت
#!/usr/bin/env python3
"""
Simple script that implements the minecraft protocol
to create a basic chat client for said game.
No encryption, no online mode, no parsing of chat messages.
I tried to make it as extendable as possible, so hack away.
PEP8 Note: Ignored E302 (2 newlines between functions)
"""