Skip to content

Instantly share code, notes, and snippets.

View aronson's full-sized avatar

aronson

View GitHub Profile
@aronson
aronson / README.md
Last active February 22, 2024 13:54
Cogmind Wineskin for Apple Silicon

Running Cogmind as a self-contained app on macOS

Cogmind can be run as a self-contained app on macOS with the modern version of Wineskin Server.

If you are interested in only the performance mods skip to here.

Installing Wineskin

Installing Rosetta 2 (Apple Silicon only)

Wineskin requires the Rosetta 2 framework available from Apple for free. Open your terminal.app from Applications and run the following command to install it if not already present:

@aronson
aronson / blend.c
Last active September 16, 2023 12:43
Thoughts on accurate ARM NEON SDL alpha blending blitters
#include <arm_neon.h>
#include <SDL.h>
/**
* NEON operates at up to 128 bit width and supports mostly the same operations BlitNtoNPixelAlpha_SSE4_1 and _AVX2 use
* save for shuffling.
* We have several problems to solve, some easier than others. We need to reorder the input src pixel stream efficiently.
* At 128 bits this is 4-wide, similar to SSE4.1. We can assemble lookup tables that NEON will use to place the data
* appropriately into a new vector, instead of shuffling in-place.
* We need to use a similar approach to extract alpha dynamically to splat it as the extract functions want immediate
❯ make -j8 mac-app-tiles TILES=y
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C rltiles all ARCH=arm64-apple-darwin21.3.0 NO_PKGCONFIG=Yes TILES=y
* If you experience any problems building Crawl, please take a second look
* at INSTALL.md: the solution to your problem just might be in there!
CXX acquire.o
CXX act-iter.o
CXX areas.o
CXX ability.o
CXX actor.o
@aronson
aronson / Safe Trades.md
Last active March 8, 2020 03:13
Trade safely in Mudae when some user is a bad actor

Mudae Safe Trading Process

Problem

As a user, someone starts an unexpected trade and I lose kakera or a waifu I didn't mean to trade.

A malicious trade

Alice: hey bob want miku for zero two?
Bob: sure

open System
// Attempts to read a string and parse it into an integer
// If the string was not an integer, return "None", otherwise return "Some (integer)"
// I absolutely stole this code from the internet. Don't worry about it too much, it's just a shortcut.
// I don't really get the syntax either, but shit works
let (|Int|_|) str =
match System.Int32.TryParse(str) with
| (true,int) -> Some(int)
| _ -> None
@aronson
aronson / Base64Coder.java
Last active January 3, 2016 22:19
A small piece of example java code to fetch an image from URL
// Copyright 2003-2010 Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
// www.source-code.biz, www.inventec.ch/chdh
//
// This module is multi-licensed and may be used under the terms
// of any of the following licenses:
//
// EPL, Eclipse Public License, V1.0 or later, http://www.eclipse.org/legal
// LGPL, GNU Lesser General Public License, V2.1 or later, http://www.gnu.org/licenses/lgpl.html
// GPL, GNU General Public License, V2 or later, http://www.gnu.org/licenses/gpl.html
// AL, Apache License, V2.0 or later, http://www.apache.org/licenses
[Unit]
Description=Sphinx - SQL Full Text Search Engine
After=local-fs.target network.target mysqld.service
[Service]
Type=forking
PIDFile=/var/lib/sphinx/log/searchd.pid
ExecStart=/usr/bin/searchd --config /etc/sphinx/sphinx.conf
ExecStop=/usr/bin/searchd --config /etc/sphinx/sphinx.conf --stopwait