Skip to content

Instantly share code, notes, and snippets.

View leoncvlt's full-sized avatar

Leonardo Cavaletti leoncvlt

View GitHub Profile
@leoncvlt
leoncvlt / python_boilerplate.py
Last active July 14, 2022 04:44
Boilerplate for a simple python script with arguments parsing and coloured logging
import sys, argparse, logging
log = logging.getLogger(__name__)
def main():
# set up argument parser
parser = argparse.ArgumentParser(description='A simple python script')
parser.add_argument('target', help='positional argument')
parser.add_argument("-s", "--string", help="An optional string argument")
parser.add_argument("-b", "--bool", action="store_true", default=False, help='An optional boolean argument')
@leoncvlt
leoncvlt / quake3-droplet-server.md
Last active August 23, 2021 21:33
Quake 3 server setup on Digital Ocean
  • Create the Digital Ocean Droplet
  • Install quake3-server:
sudo apt-get update
sudo apt install quake3-server
  • Copy your Quake 3 game files to /usr/share/games/quake3/baseq3
  • Install both the Quake 3 package as well as the application game-data-packager to create a non-distributable Quake 3 data package: sudo apt install quake3 game-data-packager innoextract
  • Package the data files: game-data-packager -i quake3 /usr/share/games/quake3/baseq3/pak0.pk3
  • You can now start the server: quake3-server
@leoncvlt
leoncvlt / evenvo.bat
Last active March 30, 2020 18:09
evenvo.bat | a batch file for easy python virtual environment operations
@echo off
echo [ evenvo ] easy virtual environment operations
IF "%~1" == "" GOTO Initialize
IF "%~1" == "init" GOTO Initialize
IF "%~1" == "freeze" GOTO Freeze
IF "%~1" == "build" GOTO Build
IF "%~1" == "gitignore" GOTO GitIgnore
@leoncvlt
leoncvlt / FlxImmersive.md
Last active November 16, 2019 15:11
Immersive Sticky Mode Android Haxeflixel

Using Immersive Sticky Mode (Android 4.4+)

The Immersive Mode on Android hides all system bars when the app is running, thus giving you access to the full width and height of the screen (this is useful for getting integer aspect ration when zooming).First you have to find the the template GameActivity.java file that the system uses to generate the apps code. Usually it is located at HaxeToolkit\haxe\lib\lime[currentVersion]\templates\android\template\src\org\haxe\lime then modify it to include

import android.view.KeyEvent; 

in the imports field, and