Skip to content

Instantly share code, notes, and snippets.

View alexanderankin's full-sized avatar

David Ankin alexanderankin

View GitHub Profile
package info.ankin.example;
import io.micrometer.tracing.handler.DefaultTracingObservationHandler;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
@alexanderankin
alexanderankin / OpenGlChangeColors.java
Created September 19, 2023 18:24
start a window, listen for keyboard events and change color by clearing the color bit/buffer
package com.youtube.ElegantWhelp.tutorial;
import lombok.RequiredArgsConstructor;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.GL11C;
import javax.swing.*;
import java.awt.*;
@alexanderankin
alexanderankin / hello-ursina.py
Created September 16, 2023 23:04
ursina examples
from ursina import *
window.borderless = False
window.title = "hello-world"
app = Ursina()
player = Entity(model="cube",
color=color.blue,
texture="white_cube",
scale_y=2)
package com.learnopengl;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.*;
import java.nio.IntBuffer;
import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL15C.glBufferData;
import static org.lwjgl.system.MemoryUtil.NULL;
# https://www.virtualbox.org/wiki/Linux_Downloads
curl -fSsL 'https://www.virtualbox.org/download/oracle_vbox_2016.asc' | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/download.virtualbox.org.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/download.virtualbox.org.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" \
| sudo tee /etc/apt/sources.list.d/download.virtualbox.org.list
sudo apt update
libsgx-ae-epid - Intel(R) Software Guard Extensions QE and PvE
libsgx-ae-id-enclave - Intel(R) Software Guard Extensions Data Center Attestation Primitives ID enclave
libsgx-ae-le - Intel(R) Software Guard Extensions LE
libsgx-ae-pce - Intel(R) Software Guard Extensions PCE
libsgx-ae-qe3 - Intel(R) Software Guard Extensions QE3
libsgx-ae-qve - Intel(R) Software Guard Extensions QVE
libsgx-ae-tdqe - Intel(R) Trust Domain Extensions QE
libsgx-aesm-ecdsa-plugin - ECDSA Quote Plugin for Intel(R) Software Guard Extensions AESM Service
libsgx-aesm-epid-plugin - EPID Quote Plugin for Intel(R) Software Guard Extensions AESM Service
libsgx-aesm-launch-plugin - Launch Plugin for Intel(R) Software Guard Extensions AESM Service
FROM ubuntu:20.04
RUN \
apt-get update -qq && \
apt-get install --yes wget && \
wget -O- https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key > /etc/apt/trusted.gpg.d/intel-sgx-deb.key && \
echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/intel-sgx-deb.key] https://download.01.org/intel-sgx/sgx_repo/ubuntu $(. /etc/os-release; echo $VERSION_CODENAME) main" > /etc/apt/sources.list.d/intel-sgx.list && \
apt-get update -qq && \
apt-get install --yes \
libsgx-quote-ex \
@alexanderankin
alexanderankin / SingleFileApplication.java
Last active September 15, 2023 18:49
single file application
package org.example.SingleFileApplication;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.annotation.Id;
import org.springframework.data.domain.PageRequest;
@alexanderankin
alexanderankin / Strings.java
Created September 9, 2023 22:19
java utf8 ideas
package java_utf.utf8;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.IntStream;
import java.util.stream.StreamSupport;
public class Utf8Strings {
public static void main(String[] args) {
byte[] bytes = "abc".getBytes(StandardCharsets.UTF_8);
@alexanderankin
alexanderankin / README.md
Created August 21, 2023 08:29
pipe logs to s3