Skip to content

Instantly share code, notes, and snippets.

View azriel91's full-sized avatar
🤍
instilling peace

Azriel Hoh azriel91

🤍
instilling peace
View GitHub Profile
@azriel91
azriel91 / paint_net_install.sh
Created February 27, 2021 07:58
Wine paint.net
sudo apt install wine winetricks
winetricks -q dotnet472
wine ~/Downloads/Paint.NET.3.5.11.Install.exe
@azriel91
azriel91 / starship.toml
Last active May 14, 2024 01:52
Starship configuration
format = """\
$time\
$directory\
$memory_usage\
$env_var\
$git_branch\
$git_commit\
$git_state\
$git_status\
$cmd_duration\
@azriel91
azriel91 / source_error.rs
Created September 19, 2020 08:40
Source Error
/// Information pertaining to an error from a source file.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SourceError<'path, 'source> {
/// Path to the file that contains the source.
pub path: &'path Path,
/// The expression that this error is for.
pub expr: Expr<'source>,
/// The suggestion or hint to provide to the user.
pub suggestion: Option<Suggestion<'source>>,
/// Whether this is a denied error or warning.
@azriel91
azriel91 / base16-tomorrow-night-bright.tmTheme
Last active July 26, 2020 20:02
Sublime Text 3 - Tomorrow Night Bright colour scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Template: Chris Kempson, Scheme: Chris Kempson (http://chriskempson.com)</string>
<key>name</key>
<string>Base16 Tomorrow Night Bright</string>
<key>semanticClass</key>
<string>theme.base16.tomorrow-night-bright</string>

Using Thread Profiler

In Cargo.toml, include the following:

[dependencies]
thread_profiler = { version = "0.3", optional = true } # the optional is important

[features]
profiler = ["thread_profiler", "thread_profiler/thread_profiler"]
# Unfortunately the Pinta compiled by this docker image seems to crash with memory errors.
# Use the official image as a parent image
FROM ubuntu:20.04
RUN apt update -y
RUN apt upgrade -y
RUN export DEBIAN_FRONTEND=noninteractive && ln -fs /usr/share/zoneinfo/Pacific/Auckland /etc/localtime && apt install -y tzdata build-essential mono-complete mono-devel pkg-config apt-utils mono-xbuild automake autoconf yelp-tools intltool libglib2.0-cil-dev libgtk2.0-cil-dev && dpkg-reconfigure --frontend noninteractive tzdata
# Set the working directory
# Listen to UDP packets through port 1234
sudo tcpdump -i lo -n udp port 1234
# UDP "server"
nc -lu 127.0.0.1 1234
# UDP "client"
nc -u 127.0.0.1 1234

Invoked like so:

// State
MapSpawner::spawn_world(&mut data.world, asset_id);

// System
MapSpawner::spawn(&mut system_data, asset_id);
@azriel91
azriel91 / how_to_write_a_good_cli_application.md
Last active January 8, 2020 11:08
Notes on how to write a good CLI application

How To Write A Good CLI Application

Modes

  • Interactive: For humans.
  • Non-interactive: For computers.

Interactive Mode

  • Print informatives to stderr.

Keybase proof

I hereby claim:

  • I am azriel91 on github.
  • I am azriel91 (https://keybase.io/azriel91) on keybase.
  • I have a public key ASDjThflIFQ4rkXraacbtts1GCRtfiTc1eEcd75gOPK6BAo

To claim this, I am signing this object: