Skip to content

Instantly share code, notes, and snippets.

@Sonata26
Sonata26 / valheim-console-guide.md
Last active April 17, 2023 09:14
Valheim Console Commands Guide Backup
@syncom
syncom / mutt-with-gmail-gpg-macosx.md
Last active December 15, 2023 23:11
Configure Mutt to work with Gmail + GPG on Mac OS X

Mutt (or NeoMutt) with Gmail and GPG, Mutiple Accounts

This note describes how to set up the Mutt or NeoMutt email client to work for Gmail and GnuPG, for two Gmail accounts. The method can be trivially extended to more than two accounts. The configuration should work for both macOS and Linux.

Software versions

@talaviram
talaviram / add_debug_entitlement.sh
Last active April 8, 2024 21:42
Simple Utility Script for allowing debug of hardened macOS apps.
#! /bin/bash
# Simple Utility Script for allowing debug of hardened macOS apps.
# This is useful mostly for plug-in developer that would like keep developing without turning SIP off.
# Credit for idea goes to (McMartin): https://forum.juce.com/t/apple-gatekeeper-notarised-distributables/29952/57?u=ttg
# Update 2022-03-10: Based on Fabian's feedback, add capability to inject DYLD for sanitizers.
#
# Please note:
# - Modern Logic (on M1s) uses `AUHostingService` which resides within the system thus not patchable and REQUIRES to turn-off SIP.
# - Some hosts uses separate plug-in scanning or sandboxing.
# if that's the case, it's required to patch those (if needed) and attach debugger to them instead.
@mariohercules
mariohercules / CoreSimulator-Clean.txt
Last active April 26, 2024 18:12
~/Library/Developer/CoreSimulator/Devices - Clean
# Delete/Clean XCode /CoreSimulator/Devices/ folder
$ xcrun simctl delete unavailable
@gcatlin
gcatlin / sdl-metal-example.m
Last active April 20, 2024 13:04
Minimal C SDL2 Metal example
//
// cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out
//
#include <SDL.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
int main (int argc, char *args[])
{
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
use std::path::PathBuf;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::thread;
use std::os::raw::c_void;
use std::rc::Rc;
use std::cell::{Cell, RefCell};
use std::i16;
use std::time::Instant;
use failure::{err_msg, Error};
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@floooh
floooh / cmake_funcs.txt
Last active September 26, 2020 21:51
Fips generator example to copy files during build process
To invoke the generator from the cmake target you should define a helper macro in you project root's "fips-include.cmake" file:
macro(copy_files yml_file)
fips_generate(FROM ${yml_file}
TYPE filecopy
OUT_OF_SOURCE
ARGS "{ deploy_dir: \"${FIPS_PROJECT_DEPLOY_DIR}\" }")
endmacro()
In your cmake target definition you would then use this like:
@vurtun
vurtun / api.md
Last active August 6, 2020 06:40
API Design: Modular Data-oriented processes

API Design: Modular Data-oriented processes (June-2017)

This is the second entry in my series about API design. While I wrote about granularity and request based APIs in my last post I want to write about API design and code architecture for modular data-oriented process this time. This is basically the write up of my findings while writing and finishing the core of my current GUI research quarks.

Actually sparking my interest for writing up my findings however was rasmusbarr@github (rasmusbarr@twitter) releasing his small data-oriented and SIMD-optimized 3D rigid body physics library. I noticed a lot of overlap in design between his physics and my GUI library and wanted to write up some general thoughts about what seems

Where you able to produce a binary directly from the Rust build tools that you could submit to the app/play store?


Not quite, but I tried to get as close to that as was reasonably possible. Alas, things ended up a little convoluted.

For iOS, I have a nearly empty Xcode project with a build script that copies my cargo produced executable into the .app that Xcode generates (before Xcode signs it). The build script also uses lipo to merge the executables for each architecture I’m targeting (e.g. armv7 and aarch64 for non-simulator devices) into a single, universal binary.

On top of that, there are various iOS-y things that need to happen before my application’s main method is called. SDL2 provides the Objective-C code that does all of that. In a C or C++ game, SDL2 renames main to SDL_main, and then [inserts its own mai