Skip to content

Instantly share code, notes, and snippets.

module CountInversion where
import Control.Arrow
type Count = Int
type Size = Int
{- |
>>> countInversion [19,11,10,7,8,9,17,18,20,4,3,15,16,1,5,14,6,2,13,12]
114
-}
@Sebas-h
Sebas-h / mdbook-page-toc.js
Created October 28, 2021 07:44
Userscript - mdBook Page ToC
function populatePageToc() {
// Source: https://github.com/JorelAli/mdBook-pagetoc
// Modified:
// Un-active everything when you click it
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el) {
el.addEventHandler("click", function () {
Array.prototype.forEach.call(document.getElementsByClassName("pagetoc")[0].children, function (el) {
el.classList.remove("active");
});
@nevrome
nevrome / data.txt
Last active October 31, 2022 13:25
Minimal Haskell parsec example
Sample1 [1100±30]
Sa2 [3200±50]
Sa3 [1400±20]
Sa4 [2000±30]
Sa6 [133413±70]
Sa7 [1300±30]
Sample9 [1300±50]
S8 [1600±30]
@minoki
minoki / atcoder-code-prettify.user.js
Last active June 4, 2023 00:38
AtCoderのシンタックスハイライトをちゃんと言語に応じて動作させるUserScriptです
// ==UserScript==
// @name AtCoder Code Prettify
// @namespace https://miz-ar.info/
// @include https://atcoder.jp/contests/*/submissions/*
// @version 3
// @grant none
// @run-at document-start
// ==/UserScript==
console.debug("AtCoder Code Prettify is running");
@huytd
huytd / todo.vim
Created June 14, 2020 07:34
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal
@bertrandmartel
bertrandmartel / doc.txt
Created June 6, 2020 12:03
Override file type by using vim modeline
= Introduction to AsciiDoc
Doc Writer <[email protected]>
A preface about https://asciidoc.org[AsciiDoc].
== First Section
* item 1
* item 2
@monomadic
monomadic / nix-shell-winit.md
Last active December 6, 2022 18:43
Creating and compiling a Rust X11 GUI application with Winit under NixOS

Creating and compiling a Rust GUI application under NixOS

Using a Nix-Shell

{ pkgs ? import <nixpkgs> { }, lib ? pkgs.stdenv.lib }:

pkgs.mkShell rec {
  name = "rust-env";
@jessechounard
jessechounard / main.c
Last active September 21, 2023 02:08
Simple texture rendering in FNA3D
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define MOJOSHADER_NO_VERSION_INCLUDE
#define MOJOSHADER_EFFECT_SUPPORT
#include <mojoshader.h>
#include <mojoshader_effects.h>
#define SDL_MAIN_HANDLED
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 1, 2025 07:13
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like [Unreal](https:

// Lexer
#define TOK_CHAR(ch1, tok1) \
case ch1: \
next_ch(); \
tok = TOK_##tok1; \
tok_prec = 0; \
break;
#define TOK_EXPR(ch1, tok1, prec1, lexpr1, rexpr1) \