Skip to content

Instantly share code, notes, and snippets.

Leonard Ritter paniq

  • Duangle GbR
Block or report user

Report or block paniq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:fb6aff95fb2cdf6e5fd358f3069f25ad
do
using import struct
struct T
a = 0
RcT := (Rc T)
struct Container
data : RcT
View corona_per_capita.txt
using data from https://coronavirus.jhu.edu/map.html: 3/13/2020 3:53:03 p.m.
infected population per capita^-1
US 1,268 327,200,000 258,044
japan 639 126,800,000 198,435
UK 593 66,440,000 112,040
austria 302 8,822,000 29,211
germany 3,059 82,790,000 27,064
View cast_ray.sc
fn iCube (ro rd)
""""For ``ro + rd * t`` returns near and far ``t`` that intersect with
a cube of unit size at origin, as well as a boolean indicating
whether a hit was made, and normal vectors for entry and exit point
which can also be used as integer offsets into the neighboring cubes.
let stp = (sign rd)
# avoid a situation where inf - inf = nan
let p = ((- ro) * stp)
let rdinv = (/ (abs rd))
let h0 = ((p - 0.5) * rdinv)
View oligarchy.sc
using import ..tukan.random
local rnd : (Random)
'seed rnd 1234
let NUM_PLAYERS = 4
let NUM_ROUNDS = 32
let START_MONEY = 100
View gist:57f5ddf3bf4b1b24a29d5d66a14043a3
fn... linear->sRGB
case (x : f32,)
mix
1.055 * (x ** (1.0 / 2.4)) - 0.055
12.92 * x
step x 0.0031308
case (x : vec3,)
mix
1.055 * (x ** (vec3 (1.0 / 2.4))) - 0.055
12.92 * x
View cl.sc
#!/usr/bin/env scopes
using import console
#using import ...conspire.module
let source-path argc argv = (script-launch-args)
# transform command line to symbolic list
let cmd =
fold (cmd = '()) for i in (rrange 0 argc)
let arg = (argv @ i)
View lmdb_fmt.txt
A module consists of three key-value stores mapping following types:
Blob DB: Id (u32) -> blob (arbitrary size...)
Hash DB: SHA-1 Hash (u160) -> Id (u32)
Edge DB: Edge IdId IdId (2 x u64) -> IdId (u64)
All keys and values are aigned to 8 bytes.
An Id is a integer mapping to a unique sequence of bytes. Simultaneously
with the Id, a hash DB is filled that maps the sequence's SHA-1 value to
View gist:cf453b79a171d677dcb7ea6b9602c722
do
enum Options
A : i32 i64 i64
B : i64 (vector i32 4)
fn testval (x y z)
let rad =
Options.A x y z
dispatch rad
case A (a b c)
View glmtest.cpp
// gcc glmtest.cpp -o glmtest -lstdc++ && ./glmtest
#include <stdio.h>
#include <glm/glm.hpp>
using namespace glm;
void print(const vec3 &v) {
printf("%f %f %f\n\n", v[0], v[1], v[2]);
}
View stb_image_ex.c
#ifndef STBI_INCLUDE_STB_IMAGE_EX_H
#define STBI_INCLUDE_STB_IMAGE_EX_H
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned char stbi_uc;
extern void stbi_flip_y(int w, int h, int comp, stbi_uc *data);
You can’t perform that action at this time.