Skip to content

Instantly share code, notes, and snippets.

View Sundwell's full-sized avatar

Sundwell Sundwell

View GitHub Profile
@Sundwell
Sundwell / aggregate-deploys.sh
Created October 7, 2025 20:33
Get commit deploys diff from particular workflow
#!/usr/bin/env bash
set -Eeuo pipefail
PAIRS=${PAIRS:-3}
EXTRA_SCAN=${EXTRA_SCAN:-10}
OUTFILE="${1:-deploy-diffs-$(date +'%Y-%m-%d').md}"
mapfile -t PROJECTS < <(find . -maxdepth 2 -mindepth 1 -type f -name "get-deploys-diff.sh" -exec dirname {} \; | sort -u)
if [[ ${#PROJECTS[@]} -eq 0 ]]; then
@Sundwell
Sundwell / pagination.js
Last active August 5, 2025 17:22
Paginator Raw Logic
const offsetLeft = 2
const offsetRight = 2
const maxPageCount = 5
const getPages = (totalRecords, pageSize, currentPage) => {
const totalPages = Math.ceil(totalRecords / pageSize)
if (totalPages <= maxPageCount) {
return [...Array(totalPages).keys()]
}
@Sundwell
Sundwell / callable_state_machine.gd
Created September 19, 2024 00:00
Godot nodeless state machine
class_name CallableStateMachine
var state_dictionary = {}
var current_state: String
func add_states(
normal_state_callable: Callable,
enter_state_callable: Callable = Callable(),
leave_state_callable: Callable = Callable()
@Sundwell
Sundwell / gist:5a235677102cf7201213db7807e9b8dd
Created July 4, 2023 22:22
Vue.js limit characters length
<template>
<input type="text" :value="value" @input="updateValue" />
{{value}}
</template>
<script>
import { ref } from "vue";
export default {
name: "App",