Skip to content

Instantly share code, notes, and snippets.

View FLAK-ZOSO's full-sized avatar
๐Ÿ‡ช๐Ÿ‡ช
studying in Estonia

Mattia Marchese FLAK-ZOSO

๐Ÿ‡ช๐Ÿ‡ช
studying in Estonia
View GitHub Profile
with open('file.txt', 'r') as file:
lines = file.read().split('\n') # lines is a list of the lines of the file
dictionary: dict = {}
for index, line in enumerate(lines):
line = line.split(' ')
dictionary[str(index)] = {
"white": line[0],
"black": line[1],
"white score": line[2],
"black score": line[4]
@ofhouse
ofhouse / install-java-versions.md
Created October 13, 2020 15:16
Install and manage multiple Java SDK versions on Ubuntu

Install and manage multiple Java versions on Ubuntu

This guide shows per example the installation of the Java SDK versions 8 (LTS, already installed) and 11 (LTS).

1. Check which Java versions are avaialable or already installed

apt --names-only search "openjdk-.*jre$"

> Sorting... Done
@Soheab
Soheab / wait_for in command.md
Last active July 11, 2023 16:56
Examples for a wait_for in ext.commands.

This gist shows how to make the bot wait for a message or reaction after doing a command. This should not be copypasted.

Docs

Check the discord.py docs for a detailed explanation of how it all works internally and which kwargs it takes.

Commands

See here two commands, one waiting for any message in a channel and the other waiting for a reaction with a specific emoji.

Check

@fnky
fnky / ANSI.md
Last active April 27, 2025 19:05
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
DROP DATABASE IF EXISTS ๐Ÿ“š;
CREATE DATABASE ๐Ÿ“š;
USE ๐Ÿ“š;
CREATE TABLE ๐Ÿ‘ค(
๐Ÿ”‘ INTEGER PRIMARY KEY,
๐Ÿ—ฃ varchar(64), -- name
๐Ÿ—“ DATE -- date of registration
@gboeing
gboeing / pypi.md
Last active June 17, 2022 16:11
How to organize and distribution a package on pypi

To distribute a package on pypi

Directory structure

/project/
    /package/
        __init__.py
        module.py
 setup.py
Development Status :: 1 - Planning
Development Status :: 2 - Pre-Alpha
Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
Development Status :: 6 - Mature
Development Status :: 7 - Inactive
Environment :: Console
Environment :: Console :: Curses
Environment :: Console :: Framebuffer
@roachhd
roachhd / README.md
Last active April 22, 2025 07:38
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

@mattieb
mattieb / time_del.py
Last active February 28, 2022 22:02
Time various methods of removing a possibly-present item from a dict
#!/usr/bin/python
import time
def new_d():
return {
1: 2, 3: 4, 5: 6, 7: 8, 9: 10,
11: 12, 13: 14, 15: 16, 17: 18, 19: 20
}
@browny
browny / simple_socket_example.c
Last active April 4, 2025 07:35
simple socket example in C
/* --- Usage --- */
g++ server.c -o server
g++ client.c -o client
./server
./client 127.0.0.1
/* --- server.c --- */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>