Skip to content

Instantly share code, notes, and snippets.

View kyle-aoki's full-sized avatar

Kyle Aoki kyle-aoki

  • Austin, TX
View GitHub Profile
@kyle-aoki
kyle-aoki / changelog.xml
Created January 18, 2024 03:57
Liquibase Configuration
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.10.xsd">
<includeAll path="migrations" />
</databaseChangeLog>
@kyle-aoki
kyle-aoki / program-fn.go
Last active July 26, 2023 21:27
An approach to exposing go functions over HTTP
var RawFunctionMap = map[string]func(inputbytes []byte) (outputbytes []byte){}
func ProgramFnRegister[Input any, Output any](fn func(input Input) Output) {
// e.g. "tt/pkg/student.FnCreateStudent"
funcName := runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()
rawFn := func(inputbytes []byte) []byte {
var input Input
if len(inputbytes) != 0 {
check(json.Unmarshal(inputbytes, &input))
@kyle-aoki
kyle-aoki / monaco-text-editor-setup.tsx
Last active July 28, 2023 14:48
Monaco Text Editor Setup
export const Outer = styled.div`
height: 100%;
width: 100%;
max-height: 100%;
max-width: 100%;
overflow: hidden;
position: relative;
`;
export const Inner = styled.div`
height: 100%;
@kyle-aoki
kyle-aoki / logback.xml
Created February 1, 2023 21:14
sensible logback configuration
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOGS" value="./logs" />
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%boldMagenta(%date{yyyy-MM-dd HH:mm:ss a, America/Chicago} CST) %cyan(%-4level) %boldBlue(%logger{0}): %msg%n%throwable
</Pattern>
@kyle-aoki
kyle-aoki / allow-port-80.txt
Created January 28, 2022 00:01
Allow Port 80
sudo sysctl net.ipv4.ip_unprivileged_port_start=79
@kyle-aoki
kyle-aoki / local-postgresql-db.yml
Last active October 23, 2021 05:59
Docker Compose File To Start Local PostgreSQL Server
version: '3.1'
services:
postgres-db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: pass
ports:
- '5432:5432'
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
type UUID = string;
interface Meta {
@kyle-aoki
kyle-aoki / prevent-scrollbar.css
Last active July 28, 2023 14:50
prevent scrollbar from moving page when it appears
html { margin-left: calc(100vw - 100%); }