Skip to content

Instantly share code, notes, and snippets.

@robkamp
robkamp / ColorElements.ajs
Last active May 14, 2024 20:35
#jArchi Color the selected elements with web safe colors
// Author: Rob Kamp
// Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
// Purpose: Color the selected elements with web safe colors
// Date: 2019-11-20
// Version 1.1
// Change: changed the title to add the #jArchi tag
console.log("Start: Color the selected elemets");
// Web safe colors
@jbsarrodie
jbsarrodie / Merge multiple concepts (and delete others).ajs
Last active May 14, 2024 20:34
#jArchi script to merge multiple concepts (and delete others)
// Merge multiple concepts (and delete others)
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script merges multiple concepts (and delete others)
//
// Version 1.1 (2020/01/20) Add an option to keep only the content of the "target" concept
// Version 1.0 (2019/11/12) First version published
//
// Known limitation: works only on elements, not relationships
@jbsarrodie
jbsarrodie / Delete unused elements and relationships.ajs
Created March 2, 2020 15:33
#jArchi scripts to delete any element (or relationship) not used in at least one view
// Delete unused elements and relationships
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script will delete any element or relationship not used in at least one view
//
// (c) 2020 Jean-Baptiste Sarrodie
var response = window.confirm("This script will delete any element or relationship not used in at least one view. Continue?");
<!DOCTYPE html>
<html>
<head>
<style>
.editor { font-family: 'Roboto Mono', monospace; font-size: 12px; outline: none; overflow-y: auto; padding-left: 48px; counter-reset: line; }
.editor div { display: block; position: relative; white-space: pre-wrap; }
.editor div::before { content: counter(line); counter-increment: line; position: absolute; right: calc(100% + 16px); opacity: 0.5; }
</style>
</head>
@timolaine
timolaine / Insert Labels of Related Elements.ajs
Last active May 14, 2024 20:34
Insert Labels of Related Elements in Archi
@nymous
nymous / README.md
Last active May 14, 2024 20:34
Logging setup for FastAPI, Uvicorn and Structlog (with Datadog integration)

Logging setup for FastAPI

This logging setup configures Structlog to output pretty logs in development, and JSON log lines in production.

Then, you can use Structlog loggers or standard logging loggers, and they both will be processed by the Structlog pipeline (see the hello() endpoint for reference). That way any log generated by your dependencies will also be processed and enriched, even if they know nothing about Structlog!

Requests are assigned a correlation ID with the asgi-correlation-id middleware (either captured from incoming request or generated on the fly). All logs are linked to the correlation ID, and to the Datadog trace/span if instrumented. This data "global to the request" is stored in context vars, and automatically added to all logs produced during the request thanks to Structlog. You can add to these "global local variables" at any point in an endpoint with `structlog.contextvars.bind_contextvars(custom

@jayluxferro
jayluxferro / Kali_Desktop_Environments_Installation_and_Removal.md
Last active May 14, 2024 20:33
Kali Desktop Environments Installation and Removal

XFCE Desktop


How to install XFCE Desktop Environment in Kali Linux:

Command:

apt-get install kali-defaults kali-root-login desktop-base xfce4 xfce4-places-plugin xfce4-goodies

How to remove XFCE in Kali Linux:

Command:

@xxRockOnxx
xxRockOnxx / laravel-tinker-login-session.md
Last active May 14, 2024 20:33
Laravel Tinker: login as another user and generate an injectable session cookie

Generating session cookie

  • Enter Laravel Tinker
php artisan tinker
  • Authenticate
@yveszoundi
yveszoundi / AlignSpread.ajs
Created May 10, 2024 12:01
#jArchi script to align and spread components
// Author: Yves Zoundi
// Requires: jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
// Purpose: Align to lowest, spread the selected elements horizontally or vertically
// Date: 2024-05-10
// Version 0.0.1
// Change: Initial version based on similar previous jArchi scripts on GitHub
console.clear()
console.show()
console.log("START: AlignSpread")
@angryziber
angryziber / React-Svelte.md
Created May 14, 2024 14:49
My React vs Svelte comparison

React vs Svelte

React Svelte
Since 2011 (before ES6) 2016 (after ES6)
Type Library (slower) Compiler (faster)
Reactivity Hooks, runtime Plain variables, compile-time
Virtual DOM (2 DOMs) Yes No
Performance Mostly ok, DOM diffing, easy to screw up Very fast by default
Memory usage High Low