Skip to content

Instantly share code, notes, and snippets.

View kalrish's full-sized avatar

David J. Shourabi Porcel kalrish

View GitHub Profile
@kalrish
kalrish / proof.md
Created November 3, 2024 12:13
Keyoxide proof for claims

openpgp4fpr:E0C3497126B72CA47975FC322953BB8C16043B43

@kalrish
kalrish / keybase.md
Created March 7, 2023 13:18
Keybase proof

Keybase proof

I hereby claim:

  • I am kalrish on github.
  • I am djsp (https://keybase.io/djsp) on keybase.
  • I have a public key ASBh-unFAXG2Pe7gW_jndDjMi1ALLDvKaPUJWiw6kU_JVwo

To claim this, I am signing this object:

@kalrish
kalrish / reflection.kt
Created August 2, 2022 15:49
Kotlin reflection
import kotlin.reflect.full.declaredMemberProperties
import kotlin.reflect.full.findAnnotation
import kotlin.reflect.full.isSubclassOf
import kotlin.reflect.KClass
@Target(
AnnotationTarget.PROPERTY,
)
@Retention(
AnnotationRetention.RUNTIME,
@kalrish
kalrish / script.sh
Created June 25, 2021 00:58
AWS Lambda Python packaging script
#!/bin/bash
set -e
source_directory="$1"
git_commit_id="$2"
deployment_bucket="$3"
shift 3
@kalrish
kalrish / cf.yaml
Created April 14, 2021 19:28
Automatic EC2 security groups
---
AWSTemplateFormatVersion: 2010-09-09
Description: 'Automatic EC2 security group.'
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
-
Label:
default: General
Parameters:
@kalrish
kalrish / glawit-check.sh
Last active March 28, 2021 14:23
Glawit test script
json_path="$(mktemp --tmpdir -- glawit-check-XXXXXXXXXX)"
aws s3api list-objects-v2 --bucket "${bucket}" > "${json_path}"
git lfs ls-files --long | while read -r line
do
oid="${line% \* rhcp/btw/*.*}"
path="${line#* \* }"
echo "${oid} -> ${path}"
jq ".Contents[] | select(.Key == \"${oid}\") | .Size" -- "${json_path}" ; path="${line#* \* }"
wc -c -- "${path}"
echo
@kalrish
kalrish / cf-kms-key.yaml
Last active March 28, 2021 14:24
KMS key with minimal policy for CloudFormation
---
AWSTemplateFormatVersion: 2010-09-09
Description: 'KMS key with minimal policy for CloudFormation'
Resources:
Key:
Type: AWS::KMS::Key
Properties: {
Description: 'Test key',
@kalrish
kalrish / iteration.c
Last active March 28, 2021 14:34
Iteration in C
#include <stdio.h> // size_t, fputc, stdout
void output
(
char c
)
{
fputc(c, stdout);
}
@kalrish
kalrish / luatex-track-require.lua
Created February 19, 2016 14:19
Lua initialization script for LuaTeX to track `require`
local texio_write = texio.write
local texio_write_nl = texio.write_nl
local function log_msg( ... )
texio_write_nl( "" )
texio_write( "TEST: " )
texio_write( ... )
texio_write( "\n" )
end