Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@amirrajan
amirrajan / readme.md
Last active September 28, 2025 08:50
xplat UI considerations for games

Things to consider when building a cross-platform game:

  1. Minimum button sizes for touch displays and small screen (eg steamdeck, mobile, nintendo switch hand held mode) is about 60 pixels. Anything smaller will fail lotcheck (Apple, Android, Nintendo).
  2. Visual feedback of UI interactions (Android, Apple -> they'll reject a feature/showcase of your game if you don't have this).
  3. Safe area/layout considerations. Avoid things like notches and app switch "chin". If you're making a game that can render edge to edge/without letter boxing, test at an aspect ratio of 21:12 (1680x960). Your safe are should be centered with an aspect ratio of 16:9 (placement of UI controls should always be in the safe area or they may be inaccesible because of notches and beveled edges).
  4. Button input detection with keyboard, touch, and gamepad. Navigation using keyboard, gamepad, mouse.
  5. Anything below 22px font size is pretty much unreadable on small screens (mobile, Steam Deck, Switch Lite).
  6. Text fields is a world of p
@amirrajan
amirrajan / main.rb
Created June 22, 2024 16:06
The Ensign - Mind Games source
class MindGames
attr_accessor :message_history, :message
def initialize game
@game = game
@message = ""
@message_history = []
@random_tips = []
end
@0xdevalias
0xdevalias / beeper-custom-theme-styles.md
Last active October 23, 2025 03:53
Custom themes/CSS styling hacks/overrides for Beeper (universal chat app aggregator, built on top of matrix)
@berichan
berichan / RaspberryPiSysBot.md
Last active January 27, 2025 17:52
How to compile SysBot.NET for linux-arm64 and run it on a raspberry pi

Preface

My Pokemon shiny raid seed checker https://cute.berichan.net/ which is essentially a dudu bot clone runs on a Raspberry Pi 4 so I thought I'd write down how I compiled an arm-64 optimized version of SysBot.NET/Pokemon.

This guide assumes you have a working and 64-bit compatible Raspberry Pi with the 64-bit version of Raspbian installed and have at least a basic understanding of how to use Raspbian/Linux. If you can't get this set up, you should ask for help in the official Raspberry Pi forums. Note, the 64-bit OS is only installable on the Pi 3 and Pi 4 (and onwards) devices. 32-bit compilation (not covered) is easier but significantly slower for a variety of things SysBot.NET uses, so I don't recommend it.

Make sure your pi is up-to-date by running sudo apt-get update then sudo apt-get dist-upgrade.

Note, This guide also assumes you have already used (with success) SysBot.NET at least once and are able to copy over your c

@rust-play
rust-play / playground.rs
Created April 9, 2019 21:35
Code shared from the Rust Playground
extern crate itertools; // 0.8.0
use itertools::Itertools; // 0.8.0
fn g(x: u32) -> u32 {
let s = x.to_string();
s.chars()
.map(|c| c.to_digit(10).unwrap())
.into_iter()
.group_by(|&x| x)
.into_iter()
@rust-play
rust-play / playground.rs
Created May 27, 2018 21:54
Code shared from the Rust Playground
#![allow(unused)]
macro_rules! nested {
($x:expr) => { ($x) };
($x:expr, $($rest:expr),+) => {
(
$x,
nested!($($rest),*)
)
};
@fallroot
fallroot / manipulating-plist-in-macos-cli.md
Created August 7, 2017 06:08
Manipulating Property List in macOS Command Line

Manipulating Property List in macOS Command Line

Tools

⚠️ defaults 명령어는 홈 경로(~)는 인식하지만 상대 경로(., ..)는 인식하지 않는다.

@VictorTaelin
VictorTaelin / promise_monad.md
Last active October 24, 2024 01:25
async/await is just the do-notation of the Promise monad

async/await is just the do-notation of the Promise monad

CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.

In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.

First, let's illustrate the 3 styles by implementing

@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender