Skip to content

Instantly share code, notes, and snippets.

@machinamentum
machinamentum / Metal.hpp
Created November 20, 2021 05:24
Metal-cpp single file header, generated from source code available at https://developer.apple.com/metal/cpp/ ; this file contains no modifications, see license notice
//
// Metal.hpp
//
// Autogenerated on November 20, 2021.
//
// Copyright 2020-2021 Apple Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@machinamentum
machinamentum / microsoft_craziness.h
Created May 19, 2019 05:51
Code for finding the path to Visual Studio by Jon Blow.
//
// Author: Jonathan Blow
// Version: 2
// Date: 7 May, 2019 (update to original version released on 31 August, 2018).
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@machinamentum
machinamentum / OpenSimplexNoise.java
Created March 26, 2019 21:03 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise algorithm based on the Simplectic honeycomb.
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of
@machinamentum
machinamentum / iso9660.h
Last active October 12, 2018 06:53
Public-domain, single-file, ISO9660 (CD image format) library.
Sorry! Moved to https://github.com/machinamentum/single-file-libs
//Only those who wish pain and frustration upon themselves shall enter; few will come out breathing machine code, eating documentation, and programming assembler in their sleep.
http://www.osdev.org/
//The holy grail of hardware/emulation documentation + emulators + debuggers for console development.
nocash.emubase.de
//Emulation technical progamming info
http://fms.komkon.org/EMUL8/HOWTO.html
public class FizzBuzz {
public static void main(String[] args) {
for(int i = 1; i <= 100; i++) {
if(i % 3 != 0 && i % 5 != 0) {
System.out.println(i);
continue;
}
if(i % 3 == 0) {
import java.io.UnsupportedEncodingException;
/**
* Converts a given String to base 26 then spits out its decimal equivalent.
* @author joshuahuelsman
*/
public class StringToNumber {
public static void main(String[] args) throws UnsupportedEncodingException {
System.out.println(args[0]);
@machinamentum
machinamentum / print_j.asm
Last active December 14, 2015 02:09
This is the simplest, smallest program to print a letter to the display. It was written in response to zhuowei's "i" program at https://github.com/zhuowei/i Unfortunately, due to the fact that this must be run as a boot sector, it must be bloated to 512 bytes. However, it takes up only 5 bytes of data itself, requires no bloated Operating System…
mov ax, 0x0E6A
int 0x10
times 510-($-$$) db 0
db 0x55 ; required for some BIOS's
db 0xAA