Skip to content

Instantly share code, notes, and snippets.

View dvtate's full-sized avatar
🐧
chilling

Dustin Van Tate Testa dvtate

🐧
chilling
View GitHub Profile
@mstewartgallus
mstewartgallus / kappacesk.hs
Last active January 15, 2021 22:45
Latest Cesk kappa calculus interpreter
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
@mstewartgallus
mstewartgallus / onekappa.hs
Last active March 29, 2021 08:41
One object kappa/zeta calculus, kind of like reflexive objects but also weird
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuantifiedConstraints #-}
import Prelude hiding (id, (.))
import Control.Category
import Control.Monad.State hiding (lift)
class Category k => Terminal k where
term :: k a ()
@mstewartgallus
mstewartgallus / profunctor.hs
Last active October 22, 2020 17:53
The kappa/zeta calculus explicitly decompose the typed lambda calculus. Combining the two categories could be represented as a profunctor. I still need to work out the details of the points tho. Decomposing typed lambda calculus into a couple of categorical programming languages http://www.kurims.kyoto-u.ac.jp/~hassei/papers/ctcs95.html
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE GADTs #-}
import Prelude hiding (Applicative (..), const)
data T = Unit | T :*: T | T :-> T
data Kappa v a b where
IdK :: Kappa v a a
@Querijn
Querijn / ddragon_example.js
Last active November 20, 2025 21:39
Get Champion by key or by ID with the latest DDragon version (Javascript)
let championByIdCache = {};
let championJson = {};
async function getLatestChampionDDragon(language = "en_US") {
if (championJson[language])
return championJson[language];
let response;
let versionIndex = 0;
@sbueringer
sbueringer / dkms-module-signing.md
Created October 16, 2019 04:22 — forked from dojoe/dkms-module-signing.md
Make DKMS sign kernel modules on installation, with full script support and somewhat distro independent

On systems with UEFI Secure Boot enabled, recent Linux kernels will only load signed modules, so it's about time DKMS grew the capability to sign modules it's building.

These scripts are extended and scriptified variants of https://computerlinguist.org/make-dkms-sign-kernel-modules-for-secure-boot-on-ubuntu-1604.html and https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur/768310#768310 and add some error checking, a passphrase around your signing key, and support for compressed modules.

dkms-sign-module is a wrapper for the more generic sign-modules which can also be used outside of DKMS.

Installation

  1. Create a directory under /root, say /root/module-signing, put the three scripts below in there and make them executable: chmod u+x one-time-setup sign-modules dkms-sign-module
@DreamVB
DreamVB / vm.c
Last active February 2, 2026 11:54
Simple Stack Virtual Machine in C
/*
Simple stack Virtual Machine
Version 1.0
by DreamVB
This is a simple example of how to code a simple VM in C
At the moment this vm only supports a small amount of instruction I hope to add more as I learn more.
This version has some hard coded example that you can test in the vm. Next version I plan to load the examples from files.
If you like this code, or if you have some improvements I can make drop me a message below:
// ==UserScript==
// @name NoPerformanceNow
// @namespace https://yuki.network/
// @version 0.2
// @description Disables performance.now() to make JavaScript exploits harder.
// @author ReimuNotMoe, ClassicOldSong
// @match *://*/*
// @grant unsafeWindow
// ==/UserScript==
@ColinEberhardt
ColinEberhardt / gist:0ab739f18576e6e90ce784a765c26b75
Created May 29, 2018 09:35
WebAssembly transform giving support for multi return values
const fs = require("fs");
const { parse } = require("@webassemblyjs/wast-parser");
const { print } = require("@webassemblyjs/wast-printer");
const identifiedToIndex = require("@webassemblyjs/ast/lib/transform/wast-identifier-to-index/index");
const t = require("@webassemblyjs/ast");
const traverse = t.traverse;
const insert = (a1, a2, index) => [
...a1.slice(0, index),
...a2,
@nadavrot
nadavrot / Matrix.md
Last active October 4, 2026 10:09
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

<!doctype>
<html>
<body>
<script type="text/javascript">
/* by m0nt0y4 */
function binaryAgent(arr) {
var charcoded = [],
finalStr = '',
i;