Skip to content

Instantly share code, notes, and snippets.

View bjesuiter's full-sized avatar

Benjamin Jesuiter bjesuiter

View GitHub Profile
@bjesuiter
bjesuiter / injectCustom.ts
Last active April 27, 2024 09:43
Angular Snippets & Tricks
// See here: https://twitter.com/tomasz_ducin/status/1781953013961085248?t=NFfNAU_RiPYF1ZaXZxJ7qA
@bjesuiter
bjesuiter / extract-files.sh
Last active April 11, 2024 13:12
Docker Tipps
#!/usr/bin/env bash
# docker run \
# --name ${container_name} \
# ${image} \
# ${cmd}
# docker cp ${container_name}:${path_to_copy} ${output_dir}
@bjesuiter
bjesuiter / mit.md
Created March 29, 2024 11:19
my-license.md

MIT License

Copyright (c) 2023 Benjamin Jesuiter (CodeMonument)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@bjesuiter
bjesuiter / convert-doc-to-pdf.applescript
Last active March 26, 2024 22:56
AppleScript Snippets
# Credits for this script to ALYB at https://forum.keyboardmaestro.com/t/applescript-save-microsoft-word-doc-x-document-to-pdf/20614
tell application "Finder"
set input to selection
end tell
tell application id "com.microsoft.Word"
activate
set view type of view of active window to draft view
@bjesuiter
bjesuiter / gist:015782a048ce674e509e82c23bbd2294
Last active November 20, 2023 16:20
Meine Lieblings-Softwareentwicklungs-Kurse / My favorite software development courses
Angular (Maximilian Schwarzmüller ): https://www.udemy.com/course/the-complete-guide-to-angular-2/
CSS (Josh W. Comeau): https://css-for-js.dev/
React (Josh W. Comeau): https://www.joyofreact.com/
Algortihms (ThePrimeagen): https://frontendmasters.com/courses/algorithms/
HTML (SelfHTML): https://wiki.selfhtml.org/wiki/Wie_fange_ich_an%3F
Go Basics (GoByExample): https://gobyexample.com/
[credential "helperselector"]
selected = wincred
[credential]
helper = wincred
autoDetectTimeout = -1
[user]
email = myemail@gmail.com
name = My Name
[pull]
ff = only
// Use this official regex: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
// See here: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
const regex =
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
const SemVer = z.string().regex(regex);
//Name: Toggle Lenovo Monitor Streaming Mode
import "@johnlindquist/kit"
// activeScene can also be 'streaming' => simply makes everything bigger on my 4K Display
const scriptDB = await db({activeScene: 'normal'});
await scriptDB.read();
if (scriptDB.data.activeScene === 'normal') {
@bjesuiter
bjesuiter / deno-behind-corporate-proxy.md
Created November 24, 2022 12:39
Deno behind Corporate Proxy
  1. Instructions: https://dev.to/jacobgc/deno-and-the-corporate-proxy-2p32
  2. Add HTTP_PROXY and HTTPS_PROXY Variables
  3. Get your corporate certificate:
  4. Instructions: https://smarie.github.io/develop-behind-proxy/know_your_proxy/#advanced-proxies-that-modify-the-ssl-certification-chain
  5. Run deno wth cert: deno run --cert C:/corporateCerts.pem https://deno.land/std/examples/welcome.ts

Alternative:

Use Proxy in HTTP_PROXY and HTTPS_PROXY with basic auth (Proxy Address: http://username:password@proxy.internal-url.de:port)

@bjesuiter
bjesuiter / observe.md
Last active July 26, 2022 23:01
observe.md

Observe

Typescript

Support of generic types as values of generic type params, which support the G<infer F> part:

type Unpacked<T, G> = T extends G<infer F> ? F: never

Related Links: