Skip to content

Instantly share code, notes, and snippets.

View ahndmal's full-sized avatar
😔
stand with my homeland Ukraine

Andrii Maliuta ahndmal

😔
stand with my homeland Ukraine
View GitHub Profile
%PDF-2.0
1 0 obj
<<
/Pages 2 0 R
/Type /Catalog
>>
endobj
2 0 obj
<<
/Count 1
use axum::{Router, routing::get, Json};
use serde::Serialize;
use std::{sync::Arc, time::SystemTime};
#[derive(Serialize)]
struct Health {
status: &'static str,
uptime_seconds: u64,
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World - Rust</title>
<script type="module" src="./index.js"></script>
</head>
<body>
<script>
<properties>
<jmh.version>1.21</jmh.version>
</properties>
<dependencies>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
</dependency>
<dependency>
@ahndmal
ahndmal / pom.xml
Created May 1, 2025 18:54
maven-jar-exec-examples
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>graal-maven-1</artifactId>
<version>0.0.2</version>
@ahndmal
ahndmal / gradle-jar-as-exec.kts
Last active August 10, 2025 17:52
gradle-jar-as-exec.kts
tasks.jar {
manifest {
attributes["Main-Class"] = "com.andmal.Main"
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
public record Point(int x, int y) {
public static final class Builder {
private int x;
private int y;
public Builder(Point point) {
this.x = point.x();
this.y = point.y();
}
public Builder x(int x) {
this.x = x;
@ahndmal
ahndmal / emacs.el
Created January 16, 2025 19:28 — forked from nilsdeppe/emacs.el
My Emacs init file
;;; initfile --- Summary:
;;; Commentary:
;; Emacs 25.1 and newer tested
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Configuration/Customization:
;; Defines global variables that are later used to customize and set
;; up packages.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
//Canvas API - An itsy bitsy taste of the massive functionality in the Canvas object.
// Basic Methods for Fills and Strokes:
ctx.globalCompositeOperation - Controls how bit blitting is performed, default is "source-over".
ctx.globalAlpha - Sets the global alpha channel.
ctx.imageSmoothingEnabled - Enables/disables image smoothing.
ctx.scale() - Scales image rendering in x,y axes.
ctx.translate() - Translates the rendering.