Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
###
# Save this as ~/.cds/cds.sh
# chmod +x ~/.cds/cds.sh
# ~/.cds/cds.sh setup
##
fail() {
echo "[$(date)] ERROR: $1"
@luke-biel
luke-biel / yaml_tilemapper.lua
Last active October 23, 2019 22:47
YAML tilemapper
MIN_SUPPORTED_VERSION = 6
-- Validate whether the version of the scripting api is compatible with this script.
function api_version_valid(version)
return version >= MIN_SUPPORTED_VERSION
end
-- Get all grid cells with atleast single pixel filled
function get_exportable_ranges(image, bounds)
local width = image.width
@luke-biel
luke-biel / pre-push.sh
Last active February 17, 2020 11:14
pre-push git hook
#!/usr/bin/env bash
# hash with 40 zeros means deleted ref
z40=0000000000000000000000000000000000000000
IFS=' '
while read -r local_ref local_sha remote_ref remote_sha
do
if [ "$local_sha" = $z40 ];
then
name: Build project
on:
pull_request: {}
push: { branches: [master] }
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
jobs:
name: Build project
on:
pull_request: {}
push: { branches: [master] }
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
jobs:
@luke-biel
luke-biel / keybase.md
Created November 19, 2020 09:01
keybase.md

Keybase proof

I hereby claim:

  • I am luke-biel on github.
  • I am apointlessdot (https://keybase.io/apointlessdot) on keybase.
  • I have a public key ASCSi6E014tEBHLBAE2nBqrVrcFRw2V_M--yZtV-y_m4zAo

To claim this, I am signing this object:

{ config, pkgs, ... }:
{
# imports
imports =
[
./hardware-configuration.nix
];
# boot
@luke-biel
luke-biel / config.el
Last active March 25, 2021 15:04
My doom emacs config
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Łukasz Biel"
user-mail-address "lukasz.p.biel@gmail.com")
@luke-biel
luke-biel / lib.rs
Created December 4, 2022 22:33
Unholy static docker containers with teardown on app exit
use bollard::container::{CreateContainerOptions, RemoveContainerOptions, StopContainerOptions, WaitContainerOptions};
use bollard::{container, Docker};
use futures_util::{pin_mut, StreamExt};
use once_cell::sync::Lazy;
use static_init::destructor;
use std::collections::hash_map::{DefaultHasher, Entry};
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use tokio::runtime::Runtime;