Skip to content

Instantly share code, notes, and snippets.

@gingerBill
gingerBill / metal_in_odin.odin
Last active April 11, 2024 18:12
Metal in Odin Natively
package objc_test
import NS "vendor:darwin/Foundation"
import MTL "vendor:darwin/Metal"
import CA "vendor:darwin/QuartzCore"
import SDL "vendor:sdl2"
import "core:fmt"
import "core:os"
@kb10uy
kb10uy / sus-specification-2.7.md
Last active May 23, 2024 07:23
SUS フォーマット v2.7 仕様

SUS Format Specification v2.7 (rev2)

注: SUS は今や Sliding Universal Score の略であり、 SeaUrchin Score ではありません。

1. 概要

  • テキストデータであり、全て printable character で構成される。
  • 拡張子: *.sus
  • EOL: CRLF もしくは LF
  • エンコード: 常に UTF-8
  • # で始まる行がデータとして意味を持ち、それ以外の行はコメントとして無視される。
  • 文字列データを指定する部分は " ~ " でクォートする。
@NotKyon
NotKyon / how to compile programs on macOS catalina.md
Created October 22, 2019 03:24
How to compile programs on macOS Catalina
clang++ -isysroot `xcrun --show-sdk-path` -o blah.out blah.cpp
@gcatlin
gcatlin / glfw-metal-example.m
Last active June 13, 2024 03:16
Minimal C GLFW Metal example
//
// cc glfw-metal-example.m `pkg-config --cflags --libs glfw3` -framework AppKit -framework Metal -framework QuartzCore
//
#define GLFW_INCLUDE_NONE
#define GLFW_EXPOSE_NATIVE_COCOA
#include <GLFW/glfw3.h>
#include <GLFW/glfw3native.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
@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");
@matthewzring
matthewzring / markdown-text-101.md
Last active June 21, 2024 14:21
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@Francesco149
Francesco149 / osu_on_linux_overhaul.md
Last active June 20, 2024 17:33
Ultimate guide to low-latency osu on linux
@mlocati
mlocati / main.c
Last active January 19, 2024 14:10
Enable/disable/check color support for Windows (ENABLE_VIRTUAL_TERMINAL_PROCESSING flag)
#define _WIN32_WINNT 0x0600
#include <stdio.h>
#include <windows.h>
#include <fileapi.h>
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
@ymyzk
ymyzk / semaphore.swift
Created August 10, 2015 19:43
Grand Central Dispatch (GCD) dispatch semaphore examples
private func example1() {
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
for i in 0..<10 {
dispatch_async(queue) {
NSLog("Start: \(i)")
sleep(3)
NSLog("End: \(i)")
}
}
}
@deadalusai
deadalusai / tasks.json
Last active September 23, 2023 03:18
VS Code tasks.json for Rust/Cargo
/*
Before using this tasks.json you may like to consider trying one of the following VS Code extensions:
rust-analyzer
Marketplace: https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer
Source: https://github.com/rust-analyzer/rust-analyzer
rls
Marketplace: https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Source: https://github.com/rust-lang/rls-vscode