Skip to content

Instantly share code, notes, and snippets.

View bjesuiter's full-sized avatar

Benjamin Jesuiter bjesuiter

View GitHub Profile
@bjesuiter
bjesuiter / box-reset.css
Created June 25, 2021 11:58
Awesome CSS Tricks
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
@bjesuiter
bjesuiter / default.conf
Created July 13, 2021 07:54
Multi-SPA Nginx Config
server {
listen 8080;
server_name localhost;
# Logging Settings
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /usr/share/nginx/www/;
index index.html;
@bjesuiter
bjesuiter / angular-api-proxy.md
Last active March 25, 2022 15:09
Development Quicktips

Angular API Proxies

Base Problem

  • Requests from Localhost to REST Services on Testing & Staging Environments may be forbidden by CORS.

Solution - Angular API Proxy

@bjesuiter
bjesuiter / grid-blowout-guard-example.css
Created May 23, 2022 09:26
Prevent CSS Grid Blowout / Overflowing it's Parent
.document-tile-control-box.desktop-mode {
// The reason for minmax(0, value) here is:
// - forces grid columns to have a defined min-width
// - which forces the grid to assume defined sizes and to not grow columns indefinitely
// - more details: https://css-tricks.com/preventing-a-grid-blowout/
grid-template-columns: minmax(0, max-content) minmax(0, max-content);
grid-template-rows: 1fr min-content min-content;
@bjesuiter
bjesuiter / policy.json
Created June 5, 2022 17:52
AWS Policy Access to Single S3 Bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetBucketLocation", "s3:ListAllMyBuckets"],
"Resource": "arn:aws:s3:::*"
},
{
"Sid": "VisualEditor0",
@bjesuiter
bjesuiter / git-connect-behind-corporate-rpoxy.md
Last active June 20, 2022 13:49
Connect to git behind corporate proxy

Connect to git behind corporate proxy.md

  1. git remote add origin <https-url>
  2. git config --global github.com.provider github
  3. git config --global credential.autoDetectTimeout -1
  4. git config --global http.proxy http://user:passwd@proxy.url:port
  5. git config --global https.proxy http://user:passwd@proxy.url:port
  6. git push --set-upstream origin main (if new repo) or
    git fetch => should both trigger git credential manager for logging into github!
@bjesuiter
bjesuiter / awesome-macos-tools.md
Last active July 1, 2022 15:38
Awesome MacOS Tools

Awesome MacOS Tooling

Problems with 4K 60Hz Monitor?

Use SwitchResX Tool! https://www.madrau.com/

Control Brightness of external Monitors

For Intel: Lunar & MonitorControl - Caschys Blog

@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:

@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)

//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') {