Skip to content

Instantly share code, notes, and snippets.

; FBX 7.5.0 project file
; ----------------------------------------------------
FBXHeaderExtension: {
FBXHeaderVersion: 1003
FBXVersion: 7500
CreationTimeStamp: {
Version: 1000
Year: 2022
Month: 6
# Welcome to Dialang!
# Lines starting with '#' are comments and are ignored.
# Everything in this file belongs to the module "main",
# used for referencing things in multiple files.
module main
# Declare a block of dialogue when you talk to "dummy".
# Syntax: talk ID NPC [CONDITIONS]? { ... }
#
#!/usr/bin/env python3
import img2pdf
import argparse
import glob
import re
parser = argparse.ArgumentParser(description="Interleave a series of images to a pdf.")
parser.add_argument("-s", metavar=".jpg", action="append", nargs="+", help="Input page range")
parser.add_argument("-o", metavar="output.pdf", help="Output filename")
/*
Include this header if __AVX512F__ is not defined for emulation, requires AVX2+FMA.
#ifndef __AVX512F__
#include "avx512emu.h"
#endif
Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
@bqqbarbhg
bqqbarbhg / gpgp.h
Last active February 17, 2021 20:53
#ifndef GPGP_INCLUDED
#define GPGP_INCLUDED
#if defined(__NVCC__)
#define uint unsigned int
#define uint32_t unsigned int
#define gpgp_kernel_1d_decl(p_name, ...)
#include "dof.h"
#include <string.h>
#include <stdint.h>
#include <math.h>
static float sample_chan(const dof_opts *opts, const dof_channel *chan, size_t x, size_t y)
{
return *(const float*)((const char*)chan->data + (y * opts->width + x) * chan->stride);
}
struct Vec2 {
a: Int
b: Int
}
def dot(a: Vec2, b: Vec2): Int {
return a.x*b.x + a.y*b.y
}
@bqqbarbhg
bqqbarbhg / sketchpad.md
Last active December 29, 2020 02:11
Language ideas

Use single quotes for "untypeable" identifiers

  • Allows using keywords and operators as names
  • Backtick could be an option
    • Hard to type on ISO layout
    • Breaks markdown embedding
  • Escapes?
    • Probably \ with '\\\'' -> \'
  • Could be used as Ruby-like symbols?
from dataclasses import dataclass
@dataclass
class DVITiming:
"""DVI horizontal/vertical timing values
Data transmission in DVI is split into two sections: The actual pixel
data and a blanking period. The blanking period contains a synchronization
pulse that is preceeded/followed by the front/back porch respectively.
The polarity of the synchronization pulse signal inside the blanking period
from nmigen import *
from nmigen.build import Platform
# Generates a VGA picture from sequential bitmap data from pixel clock
# synchronous FIFO.
#
# The pixel data in i_r, i_g, and i_b registers
# should be present ahead of time.
#