Skip to content

Instantly share code, notes, and snippets.

@enbashi
enbashi / Main.json
Last active June 29, 2024 12:26
POC: Project Scaffolding/Templating using Cookiecutter
{
"steps": [
{
"actionId": "com.datadoghq.dd.workflow_automation.triggerWorkflow",
"display": {
"bounds": {
"y": 186
}
},
"name": "Download_project_template",
@enbashi
enbashi / use-dimensions
Created February 10, 2022 15:36
custom widget resize listener
import * as React from 'react';
const getDimensions = (): { width: number; height: number } => {
return {
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight - 4,
};
};
export const useDimensions = (): { width: number; height: number } => {
@enbashi
enbashi / encryption_key
Last active January 29, 2021 01:20
backend work for private secrets
# requirement 1 (now): add a column `encryption_key` in `ui_app_installation` and pass it in the JSON body
# we already have this dep
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
encryption_key = AESGCM.generate_key(256)
# 32 bytes
>>> encryption_key
b'\x8aJ(\xbb\x88\xf2K\xd8ku:(iw\xeeK\x17*FAR\xf0K\xeb(I\xcb\xb7x\xb2+G'