- Buy the godamn module
- Get your VM with your ssh
This guide is based of this guide from RedHat. I must say it was pretty useful.
- In order to locate the SkyConnect device via USB. first run
lsusb
before plugging the module:
// MinecraftVersionSorter.js 1.0 by TheRolf | |
// to use it, just just need to pass it as arg of the sort function for an array | |
// ["1.4.9","1.7","1.7.10","1.12.2","1.17.1","1.16.210","1.18"].sort(MinecraftSorter) | |
const MinecraftVersionSorter = (a, b) => { | |
const aSplit = a.split('.').map(s => parseInt(s)) | |
const bSplit = b.split('.').map(s => parseInt(s)) | |
if(aSplit.includes(NaN) || bSplit.includes(NaN)) { | |
return String(a).localeCompare(String(b)) // compare as strings |
class RetryContext: | |
"""Retry context manager creator | |
created by TheRolf""" | |
def __init__(self, retries=1, exceptions=(Exception,), delay=0.0, on_fail=None) -> None: | |
"""Creates retry context creator | |
Args: | |
retries (int, optional): Number of retries allowed. Defaults to 1. |
This guide is based of this guide from RedHat. I must say it was pretty useful.
lsusb
before plugging the module:/** | |
* @brief Strips all the characters at the end | |
* @author TheRolf | |
* | |
* @param str target string | |
* @param chars chars to find and remove | |
*/ | |
void str_rstrip(char* str, const char* chars) | |
{ | |
size_t size_str = strlen(str); |
To create a temporary setup for pytest, you may think fixtures. But my case isn't like yours.
I needed to change tempolarly a value in the middle of my test so I could get faster results.
We will use the with
statement. It will make a dedicated "scope" to that temporary setup. I'm sure that you already used them to open files. It is particularly powerful as it creates a context manager, which increases readibility, and protects developers from themselves.
Why do clean? Because it's an addiction since I discovered C++ destructors, but above all, Rust drop trait.
First this error is not your module or your library in fault, it's the libpng library fault.
Since libpng 1.6 release, the library became more aggresive about incorrect iCCP data chunks. To fix that problem, you could go to a prior version or modify the images so that the iCCP chunk is removed.
Install ImageMagick with your packet manager:
/** | |
* Dark theme color scheme store with watch | |
* full demo at https://codepen.io/TheRolf/pen/xxzNreP | |
* @author TheRolf | |
*/ | |
window.DarkThemeStore = { | |
VALUES: { | |
AUTO: 'auto', | |
DARK: 'dark', | |
LIGHT: 'light' |
template <class Type> | |
class SmartPointer | |
{ | |
private: | |
Type * pointer; | |
public: | |
SmartPointer() : pointer(nullptr) {} | |
SmartPointer(Type * p) : pointer(p) {} | |
Type * set(Type * p) { pointer = p; return p; } | |
Type * get() { return pointer; } |
std::string from_int(int value) { | |
int tmp = value; | |
std::string valueAsString = tmp < 0 ? "-" : ""; | |
size_t pos = valueAsString.length(); | |
if(tmp < 0) tmp = -tmp; | |
else if(tmp == 0) valueAsString = "0"; | |
while(tmp != 0) { | |
int digit = tmp%10; | |
valueAsString.insert(pos,1,'0' + digit); |
let value; | |
let spaces; | |
spaces = 0; | |
console.log(value.split('\n').filter(f => f.trim().length !== 0).map(cur => { | |
if(cur.startsWith('-')) spaces ++; | |
else if(cur.startsWith('</')) spaces --; | |
else if(cur.startsWith('<')) spaces++; | |
let sp = ''; |