Skip to content

Instantly share code, notes, and snippets.

View MircoT's full-sized avatar

MircoT MircoT

View GitHub Profile
@MircoT
MircoT / test.md
Created May 27, 2024 16:11 — forked from ityonemo/test.md
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@MircoT
MircoT / genindex.cpp
Created February 16, 2022 11:00 — forked from jaburns/genindex.cpp
Generational indices in C++ vs Rust
/*
Copyright 2021 Jeremy Burns
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 copies or substantial portions of the Software.
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 O

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@MircoT
MircoT / snake.py
Created February 5, 2020 09:14
Snake game with Python and 2 different libraries (raylib and termbox)
from random import randint
class Direction:
"""The possible directions of the snake parts."""
LEFT = 0
RIGHT = 1
UP = 2
DOWN = 3
@MircoT
MircoT / cask_check_versions.py
Created May 15, 2019 08:51
Check if installed casks have multiple versions installed. If it is true, it prints the list of versions starting from the most recent.
from os import path, walk, stat
CASKROOM_PATH = path.join(
"/",
"usr",
"local",
"Caskroom"
)
@MircoT
MircoT / exercise_0.md
Last active June 26, 2021 08:24
Tutoring activity AA 2018-2019

Exercises

0: Given the following program:

ORG 100
LDA X
SNA
BUN LABEL_W
CLA
@MircoT
MircoT / docker-compose.yml
Created February 26, 2019 14:11 — forked from cboettig/docker-compose.yml
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@MircoT
MircoT / merge_all_pdf.py
Last active May 2, 2018 14:35
Merge all pdf files in the same folder of this script, using PyPDF2
#!/usr/bin/env python
"""Simple script to merge all pdf in the folder.
To do:
0. Add argparse for input from command line
1. Merge of all file in a specific folder
2. Add exclude file list
3. Add order file list, to custom the merge order
"""
@MircoT
MircoT / qcow2img.sh
Created April 4, 2018 11:07
Script to connect and mount a qcow2 image in a temporary directory. Plus, you can close the connection and check the status with fdisk or install the dependencies.
#!/bin/bash
# $2: have to be a qcow2 image
if [ $EUID != 0 ]; then
echo "You need sudo to exec commands..." ;
echo "- Remember also to install dependencies with install-deps command !"
else
case "$1" in
"connect-status" )
@MircoT
MircoT / README-Template.md
Created November 28, 2017 09:38 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites