Skip to content

Instantly share code, notes, and snippets.

View denismakogon's full-sized avatar

Denys Makogon denismakogon

View GitHub Profile
package com.hol.panama.lab_5_optional;
import com.hol.panama.stdlib.stdio.stdio_h;
import java.lang.foreign.*;
import java.lang.invoke.MethodHandle;
import static java.lang.foreign.ValueLayout.ADDRESS;
import static java.lang.foreign.ValueLayout.JAVA_INT;
import jdk.incubator.vector.DoubleVector;
import jdk.incubator.vector.VectorSpecies;
import java.time.Duration;
import java.time.Instant;
import java.util.Random;
import java.util.function.Supplier;
import java.util.stream.IntStream;
public class Task {
package com.panama.examples;
import java.lang.foreign.*;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.Arrays;
import static java.lang.foreign.ValueLayout.ADDRESS;
import static java.lang.foreign.ValueLayout.JAVA_BYTE;
#!/bin/sh
set -e
# script to install maven
# todo: add method for checking if latest or automatically grabbing latest
mvn_version=${mvn_version:-3.5.2}
url="http://www.mirrorservice.org/sites/ftp.apache.org/maven/maven-3/${mvn_version}/binaries/apache-maven-${mvn_version}-bin.tar.gz"
install_dir="/opt/maven"
@denismakogon
denismakogon / dockerfile
Created June 14, 2022 15:37
jextract dockerfile
FROM openjdk:19-bullseye as jdk19-source
FROM openjdk:18-bullseye as jextract-build-stage
COPY --from=jdk19-source /usr/local/openjdk-19 /usr/local/openjdk-19
WORKDIR tmp/
RUN apt-get update && apt-get install wget tar xz-utils git -qy --no-install-recommends
RUN mkdir deps && \
wget -O deps/LLVM.tar.gz https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.4/clang+llvm-14.0.4-x86_64-linux-gnu-ubuntu-20.04.tar.xz && \
tar -xvf deps/LLVM.tar.gz -C deps && rm -fr deps/LLVM.tar.gz && \
fn list t cloudnative
FUNCTION NAME ID TYPE SOURCE ENDPOINT
word-generator word-generator-trigger 01CWPW8PHD1BT044G0A0000003 http /word-generator-trigger http://<runner-lb-endpoint>/t/cloudnative/word-generator-trigger
$ fn inspect fn cloudnative word-generator
{
"annotations": {
"fnproject.io/fn/invokeEndpoint": "http://<runner-lb-endpoint>/invoke/01CWPW8P3R1BT044G0A0000002"
},
"app_id": "01CWPW8NJ51BT044G0A0000001",
"config": {
"WORD_SOURCE": "https://srcdog.com/madlibs/words.txt"
},
"created_at": "2018-11-19T20:58:21.688Z",
################################################################################
################################################################################
################################################################################
func withError(ctx context.Context, in io.Reader, out io.Writer) {
err := myHandler(ctx, in, out)
if err != nil {
fdk.WriteStatus(out, http.StatusInternalServerError)
out.Write([]byte(err.Error()))
return
@denismakogon
denismakogon / cold-start-old-fdk.txt
Created December 11, 2018 17:57
cold-start-old-fdk
import time: self [us] | cumulative | imported package
import time: 168 | 168 | zipimport
import time: 1150 | 1150 | _frozen_importlib_external
import time: 91 | 91 | _codecs
import time: 4804 | 4894 | codecs
import time: 88056 | 88056 | encodings.aliases
import time: 4840 | 97789 | encodings
import time: 1731 | 1731 | encodings.utf_8
import time: 204 | 204 | _signal
import time: 1318 | 1318 | encodings.latin_1
schema_version: 20180708
name: firstfunc
version: 0.0.1
runtime: go
entrypoint: ./func