Skip to content

Instantly share code, notes, and snippets.

@glasserc
glasserc / monitor.vala
Created September 14, 2011 09:40
why Vala is not my favorite programming language
// monitor.vala: why Vala is not my favorite programming language.
//
// A program to walk the filesystem tree and install FileMonitors on
// every directory found, in order to test a limit on notifications.
// This will do a TON of I/O. On my machine it takes almost an hour
// to chew through my hard drive. The good news is that it doesn't
// hit a limit.
//
// FileMonitor is implemented I think using inotify, so if you're
// running Linux, the easier way to discover these limits is:
Below I collected relevant links and papers more or less pertaining to the subject of tetrahedral meshes.
It's an ever-growing list.
------------------------------
Relevant links:
http://en.wikipedia.org/wiki/Types_of_mesh
http://en.wikipedia.org/wiki/Tetrahedron
http://en.wikipedia.org/wiki/Simplicial_complex
@slime73
slime73 / sdl-metal-example.m
Last active September 9, 2021 10:53
SDL + Metal example
/**
* This software is in the public domain. Where that dedication is not recognized,
* you are granted a perpetual, irrevokable license to copy and modify this file
* as you see fit.
*
* Requires SDL 2.0.4.
* Devices that do not support Metal are not handled currently.
**/
#import <UIKit/UIKit.h>
@felixjones
felixjones / pmx21.md
Last active May 6, 2024 15:53
PMX (Polygon Model eXtended) 2.0, 2.1 File Format Specifications

PMX (Polygon Model eXtended) 2.1

This is an English description of the .PMX file format used in Miku Miku Dance (MMD).

PMX is the successor to the .PMD format (Polygon Model Data).

This is work-in-progress! Please leave feedback in the comments.

Todo

@rygorous
rygorous / gist:159aa1c4573077126169
Created April 23, 2015 20:44
How I would like compilers to implement SSE intrinsics
So I would like to be able to write functions that use SSEx intrinsics (that are called
via some CPU dispatch mechanism) without allowing the compiler to use SSEx instructions
everywhere (because that's not under control of the runtime CPU dispatch we have).
On VC++, this is easy. I get to use whatever intrinsics I want, and the compiler will
emit the corresponding instructions. It will not use these same instructions in code
that wasn't written with intrinsics unless I specifically allow it to with a
command-line option. In GCC and Clang, this turns out to be pretty hard (or at least
there's no good way I know of). And yes, I fully realize that the under-the-hood semantics
of this are tricky, since in a modern compiler these vector intrinsics turn into an IL that
@deadalusai
deadalusai / tasks.json
Last active June 24, 2024 10:17
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
@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)")
}
}
}
@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
@Francesco149
Francesco149 / osu_on_linux_overhaul.md
Last active June 20, 2024 17:33
Ultimate guide to low-latency osu on linux
@matthewzring
matthewzring / markdown-text-101.md
Last active June 26, 2024 16:37
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: