Skip to content

Instantly share code, notes, and snippets.

View Refffy's full-sized avatar
🎯
Focusing

Danial Yekibayev Refffy

🎯
Focusing
  • Almaty, Kazakhstan
View GitHub Profile
@zohnannor
zohnannor / theme.md
Last active May 23, 2022 16:54
моя тема в вскоде
@Ethosa
Ethosa / calc.py
Created August 12, 2021 11:30
simple calc 👀 lol
# author: Ethosa
from enum import Enum
numbers = '0123456789'
operators = '+-/*'
class Type(Enum):
NUMBER = 0
OPERATOR = 1
@Ethosa
Ethosa / triangulize.py
Created August 12, 2021 06:12
triangulize
# author Ethosa
# add image named "1.jpg" to folder and run it!
from PIL import Image
from random import randint
GRID_KOEF = 65
def triangulize_block(img):
w, h = img.size
@zohnannor
zohnannor / rust1plus1.md
Created July 14, 2021 20:44 — forked from gretingz/rust1plus1.md
Proving that 1 + 1 = 2 in Rust

Proving that 1 + 1 = 2 in Rust

The fact that 1 + 1 is equal to 2 is one of those things that is so obvious it may be hard to justify why. Fortunately mathematicians have devised a way of formalizing arithmetic and subsequently proving that 1 + 1 = 2. Natural numbers are based on the Peano axioms. They are a set of simple rules that define (along with a formal system) what natural numbers are. So in order to prove 1 + 1 = 2 in Rust we first need a formal system capable of handling logic. The formal system that we'll be using is not some random crate, but Rust's type system itself! We will not have any runtime code, instead the type checker will do all the work for us.

Implementing the Peano axioms

First let's go trough the Peano axioms. The first axiom is that "Zero is a natural number". Basically what it says is that zero exists. In order to express that in the type system, we just write:

@shoghicp
shoghicp / 0.6.1.txt
Created May 17, 2013 19:55
Minecraft: Pocket Edition 0.6.1 protocol
# Minecraft PE v0.6.1 alpha Protocol #9
# 49 identified Packets
[C ==> S] 0x82 LoginPacket (String, int, int)
[C <== S] 0x83 LoginStatusPacket (int)
[C ==> S] 0x84 ReadyPacket (bits[8])
[C <== S] 0x85 MessagePacket (String)
[C <== S] 0x86 SetTimePacket (long)
[C <== S] 0x87 StartGamePacket (long, int, int, int, float, float, float)
[C <== S] 0x88 AddMobPacket (int, int, float, float, float, byte, byte, Metadata)