Skip to content

Instantly share code, notes, and snippets.

View MarcoBuster's full-sized avatar

Marco Aceti MarcoBuster

View GitHub Profile
@MarcoBuster
MarcoBuster / botogram-normal-keyboards.py
Created August 2, 2019 19:20
Small example for botogram "normal" keyboards
import botogram
import json
bot = botogram.create(...)
@bot.command("start")
def start_command(chat, message):
bot.api.call('sendMessage', {
'chat_id': chat.id,
'text': 'Welcome in the bot! What do you want to do?',
@MarcoBuster
MarcoBuster / tgsend.py
Created June 9, 2019 12:56
A very small script to send text or files over Telegram by using CLI
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
import botogram
import json
TOKEN = ''
bot = botogram.create(TOKEN)
def write(user, data):
with open(str(user.id) + ".json", "w+") as f:
json.dump(data, f)
@MarcoBuster
MarcoBuster / Tris.cpp
Last active January 16, 2024 18:04
Gioco del tris in C++
#include <iostream>
using namespace std;
const string MAP[3] = {"•", "X", "O"};
void printTris(int tris[3][3], int player, bool winner=false) {
int id = 1;
if (!winner) cout << "\t[Turno di " << MAP[player] << "]" << endl;
if (winner) {
#include <stdio.h>
#include <stdlib.h>
// Piccolo tutorial sui puntatori per gli struct e su malloc in C / C++
// Relased under Creative Commons CC0 1.0 Universal License (public domain)
struct person {
char name[30];
int age;
float weight;
#include <stdio.h>
// Piccolo tutorial sui puntatori in C / C++
// Relased under Creative Commons CC0 1.0 Universal License (public domain)
int main()
{
int var = 45;
int *pointer; // inizializza puntatore di tipo int
int array[] = {0, 1, 2, 3, 4, 5}; // inizializza array a caso
# Copyright (c) 2017 Marco Aceti. All rights reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
@MarcoBuster
MarcoBuster / Morse code.py
Created May 11, 2017 19:59
Python Morse code generator. Runs on all versions of Python.
# Copyright (c) 2017 Marco Aceti <dev@marcoaceti.it>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@MarcoBuster
MarcoBuster / Python 3.7.0 installer.sh
Last active March 13, 2019 20:44
Python 3.7.0 installer with sqlite3 and openssl libraries.
#!/bin/bash
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
@MarcoBuster
MarcoBuster / Stazioni italiane.csv
Last active March 23, 2023 12:51
Lista delle stazioni ferroviarie civili italiane, fruibile da ricerca e tabella .csv
code region long_name short_name latitude longitude
S01427 1 Ardenno Masino Ardenno Masino 46.16198 9.651374
S01947 1 Arena Po Arena Po 45.082065 9.360394
S01847 1 Asola Asola 45.220454 10.402313
S01041 1 Corbetta S. Stefano Corbetta S.Stef. 45.480829 8.917457
S01424 1 Cosio Traona Cosio Traona 46.135564 9.525498
S01207 1 Gazzada Schianno Morazzone Gazzada Schian.M 45.77862 8.824815
S02381 1 Gazzo Di Bigarello Gazzo Di Bigarel 45.176648 10.894005
S01841 1 Ghedi Ghedi 45.409439 10.280506
S02382 1 Castel D`Ario Castel D'Ario 45.183399 10.97531