This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
// Sources: | |
// - https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2021/03/24/m1cycles.cpp | |
// - https://gitea.com/matteyeux/darwin-xnu/src/branch/master/osfmk/kperf | |
// - https://patchwork.ffmpeg.org/project/ffmpeg/patch/[email protected]/ | |
// - https://github.com/GMUCERG/PQC_NEON/blob/main/neon/kyber/m1cycles.c | |
const c = @cImport({ | |
@cInclude("pthread.h"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs'); | |
const path = `${process.env.LocalAppData}\\Microsoft\\PowerToys\\FancyZones\\zones-settings.json`; | |
fs.copyFileSync(path, path + `.bk-${Date.now()}`); | |
let settings = require(path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Reflection; | |
using System.Text.RegularExpressions; | |
[AttributeUsage (AttributeTargets.Field,Inherited = true)] | |
public class ReadOnlyAttribute : PropertyAttribute {} | |
#if UNITY_EDITOR | |
[UnityEditor.CustomPropertyDrawer (typeof(ReadOnlyAttribute))] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/draw" | |
"image/png" | |
"math" | |
"math/rand" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/draw" | |
"image/png" | |
"math" | |
"math/rand" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/png" | |
"math" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/png" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#define FAST | |
#define Slice(type) Slice_##type | |
#define make_slice_type(type) \ | |
typedef struct Slice(type) {\ | |
size_t len;\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#define maybe(type) maybe_##type | |
#define some(type, v) ((maybe(type)) { .is_something = 1, .value = v}) | |
#define nothing(type) ((maybe(type)) { .is_something = 0 }) | |
#define unwrap(x) (is_nothing(x) ? abort() : 0, x.value) | |
#define is_nothing(x) (x.is_something == 0) | |
#define ifsome(x) if (!is_nothing(x)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.POSIX: | |
CC = cc | |
CFLAGS = -Ofast -fopenmp -g -Wall -Wextra | |
LDFLAGS = | |
LDLIBS = -lm | |
aidrivers: aidrivers.c | |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ aidrivers.c $(LDLIBS) | |
clean: |
NewerOlder