Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@berichan
berichan / RaspberryPiSysBot.md
Last active July 22, 2024 16:02
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
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@jfdm
jfdm / sodium-documented.h
Last active March 18, 2021 19:45
A well documented version of libNaCl and libSodium's ABI.
/** \mainpage
*
* __NaCl__ (pronounced _salt_) is a new easy-to-use high-speed
* software library for network communication, encryption, decryption,
* signatures, etc. NaCl's goal is to provide all of the core
* operations needed to build higher-level cryptographic tools.
*
* __Sodium__ is a portable, cross-compilable, installable,
* packageable, API-compatible version of NaCl.
*