Skip to content

Instantly share code, notes, and snippets.

#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdnoreturn.h>
#include <unistd.h>
#include <ucontext.h>
#include "prepare.h"
#define thread_local _Thread_local
@josephchoe
josephchoe / plan9port-on-openbsd.md
Created December 19, 2024 19:32 — forked from nc-bar/plan9port-on-openbsd.md
Configuration of plan9port on openbsd

Configuration of plan9port in openBSD

Installation

Simply

# pkg_add plan9port

The package gets installed in /usr/local/plan9 by default. To execute the plan9port's programs either add that path

Working With Buffers

Me

  • I'm Josh Branchaud
  • I work at Hashrocket
  • Twitter: @jbrancha
  • Github: @jbranchaud

Why talk about buffers?

@josephchoe
josephchoe / macos-tmux-256color.md
Created June 14, 2024 17:47 — forked from bbqtd/macos-tmux-256color.md
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@josephchoe
josephchoe / c_nostd.txt
Created May 3, 2024 13:53 — forked from tcoppex/c_nostd.txt
Writing C software without the standard library [Linux Edition] - Franc[e]sco's Gopherspace
###################################################################
Writing C software without the standard library
Linux Edition
###################################################################
There are many tutorials on the web that explain how to build a
simple hello world in C without the libc on AMD64, but most of them
stop there.
I will provide a more complete explanation that will allow you to
build yourself a little framework to write more complex programs.
@josephchoe
josephchoe / flibitPackaging.md
Created October 10, 2023 09:44 — forked from flibitijibibo/flibitPackaging.md
Hope you like reading ldd output!

A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.

This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:

http://www.flibitijibibo.com/magfest2016/

https://www.youtube.com/watch?v=B83CWUh0Log

I would recommend looking at that first! After that, read on...

@josephchoe
josephchoe / GameName.sh
Created October 10, 2023 09:28 — forked from flibitijibibo/GameName.sh
A variant of this launcher ships in every game I've worked on. While the filename here is GameName.sh, I do not use the .sh extension. Just `chmod +x` this and put your OSX bins in osx/, Linux 32-bit bins in x86/, and Linux 64-bit bins in x86_64/.
#!/bin/bash
# GameName Shell Script
# Written by Ethan "flibitijibibo" Lee
# Move to script's directory
cd "`dirname "$0"`"
# Get the kernel/architecture information
UNAME=`uname`
ARCH=`uname -m`
@josephchoe
josephchoe / free.c
Created June 14, 2023 18:18 — forked from ztmr/free.c
OpenBSD equivalent of `free' Linux command. Shows memory usage.
/*
* $Id: $
*
* Module: free -- description
* Created: 15-SEP-2008 17:56
* Author: tmr
*/
#include <stdio.h>
#include <unistd.h>
@josephchoe
josephchoe / Makefile
Created June 6, 2023 15:05 — forked from uhooi/Makefile
Makefile for iOS App development
PRODUCT_NAME := Foo
SCHEME_NAME := ${PRODUCT_NAME}
WORKSPACE_NAME := ${PRODUCT_NAME}.xcworkspace
UI_TESTS_TARGET_NAME := ${PRODUCT_NAME}UITests
TEST_SDK := iphonesimulator
TEST_CONFIGURATION := Debug
TEST_PLATFORM := iOS Simulator
TEST_DEVICE ?= iPhone 11 Pro Max
TEST_OS ?= 13.3
@josephchoe
josephchoe / connmanctl.md
Created May 24, 2023 16:27 — forked from kylemanna/connmanctl.md
Connmanctl Cheat Sheet