FBC is a template class that lays down a framework for file-based classes.
File-based classes are types that store their information in a file, then load it next time the program starts. This is helpful for custom databases and user data.
/// Formats a [`Command`] into a user-friendly representation. | |
/// | |
/// The output is formatted as `KEY1=value KEY2=value program arg1 --arg2`, where environmental | |
/// variables are first, the program is second, and the arguments are last. | |
fn display_command(command: &Command) -> String { | |
let envs = command.get_envs().filter_map(|(key, value)| { | |
let key = key.to_string_lossy(); | |
value | |
.map(OsStr::to_string_lossy) | |
.map(|value| Cow::from(format!("{key}={value}"))) |
body { | |
transition: opacity 0.5 cubic-bezier !important; | |
} | |
body *:not(:hover) { | |
opacity: 0.9; | |
} | |
body *:hover { | |
opacity: 1.0; |
gh cache delete --all |
use std::thread; | |
fn main() { | |
let mut data: u32 = 0; | |
// Get the memory address of data so it can share across threads | |
let raw_ptr_address = &mut data as *mut u32 as usize; | |
let thread1 = thread::spawn(move || { | |
// Get a pointer to the data from the address |
from enum import Enum | |
class Cell(Enum): | |
EMPTY = 0 | |
X = 1 | |
O = 2 | |
def __str__(self) -> str: | |
if self._name_ == "EMPTY": |
""" | |
In Python 3.10, the match-case statement was added. You can use this instead. | |
Check your version of Python with: | |
$ python --version | |
""" | |
x = input("> ") |
import json | |
import shutil | |
import os | |
version = input("Enter Minecraft version: ").strip() | |
index_file = f"{version}.json" | |
# Open version index and save the objects |
# Thanks to https://stackoverflow.com/a/40566052 | |
python -m pip uninstall -y -r <(pip freeze) |
public class Colors { | |
public static String reset = "\033[0m"; | |
public static String bold = "\033[1m"; | |
public static String dim = "\033[2m"; | |
public static String italic = "\033[3m"; | |
public static String underline = "\033[4m"; | |
public static String reverse = "\033[7m"; | |
public static String dimAlt = "\033[8m"; | |
public static String underlineAlt = "\033[21m"; |
FBC is a template class that lays down a framework for file-based classes.
File-based classes are types that store their information in a file, then load it next time the program starts. This is helpful for custom databases and user data.