Skip to content

Instantly share code, notes, and snippets.

@mcheshkov
mcheshkov / a.d.ts
Created December 14, 2023 00:33
ts-proto type declaration problem sample
import * as _m0 from "protobufjs/minimal";
export declare const protobufPackage = "TsProtoSample";
export interface FooRequest {
req: string;
}
export interface FooResponse {
res: string;
}
export declare const FooRequest: {
encode(message: FooRequest, writer?: _m0.Writer): _m0.Writer;
@mcheshkov
mcheshkov / build.sh
Last active October 29, 2023 18:40
Building OpenZFS for Fedora CoreOS
#!/bin/bash
FEDORA_MAJOR="38"
ARCH="x86_64"
KERNEL_VERSION="6.3.8-200.fc38"
ZFS_VERSION="2.1.12"
podman run \
--interactive \
--tty \
const TOPIC_BUFFER = 'topic';
const MSG_LEN = 7;
function topic() {
return 'topic';
return TOPIC_BUFFER.toString();
}
const SINGLE_BUFFER = Buffer.alloc(MSG_LEN);
function msg() {
package;
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Type;
class ExtendMacro {
#if macro
static function buildExtend(reference:Expr, fieldsObj:Expr){
package util;
@:genericBuild(util.JsonValidatorMacro.build())
class JsonValidator<T> {
}
@mcheshkov
mcheshkov / ShortLambdaMacroTest.hx
Last active August 29, 2015 14:22
Short lambda macro #1
class ShortLambdaMacroTest {
static function other(i:Int){
trace('ok, so $i');
}
static function using(){
Lambda.iter([1,2,3], function(i){trace(i);});
Lambda.iter([1,2,3], f(i => trace(i)));
Lambda.iter([1,2,3], f(i => {trace(i + 1); other(i);}));
}