Skip to content

Instantly share code, notes, and snippets.

View matthiasbaldi's full-sized avatar

Matthias Baldi matthiasbaldi

View GitHub Profile
oss.maxcdn.com
hiriwebsitestatic.s3.amazonaws.com
@matthiasbaldi
matthiasbaldi / $PROFILE
Last active February 26, 2024 06:45
Powershell Setup for GitPosh with Windows Terminal
# theming configuration
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox
# thanks to https://dev.to/ofhouse/add-a-bash-like-autocomplete-to-your-powershell-4257
# improved tabbing for autocompletion
# Shows navigable menu of all options when hitting Tab
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
@matthiasbaldi
matthiasbaldi / multipleJenkinsJobConfigUpdate.groovy
Created September 20, 2016 08:24
Update multiple Jenkins job configurations by specific XML property
// this script can be used to change a specific XML property of the Jenkins config.xml of a job
// to use the script, edit the variables and run it in the Jenkins Script Console
import hudson.model.*
import jenkins.model.Jenkins
import java.io.File;
import groovy.xml.XmlUtil
import static javax.xml.xpath.XPathConstants.*
import groovy.xml.DOMBuilder
import groovy.xml.dom.DOMCategory
@matthiasbaldi
matthiasbaldi / setup.md
Last active May 14, 2022 14:24
windows apps, winget

winget

winget install HandyWinget
winget install OpenJS.NodeJS.LTS
winget install Mirantis.Lens
winget install Github.cli
winget install Audacity.Audacity
winget install Microsoft.PowerShell
winget install Microsoft.PowerToys
winget install Win32diskimager.win32diskimager
@matthiasbaldi
matthiasbaldi / deactivateJenkinsCSP.groovy
Last active January 21, 2022 20:43
Deactivate Jenkins Content Security Policy
// https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy
// this line of code you can enter in your script console jenkinsserver.io/script
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
// or perisistent with this start param
-Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src '*'; connect-src '*'; img-src '*'; style-src '*';"
@matthiasbaldi
matthiasbaldi / locked_folders
Created December 5, 2021 12:33
Cleanup Windows
takeown /F "C:\Windows.old" /A /R /D Y
icacls "C:\Windows.old" /T /grant administrators:F
rmdir /s /q "C:\Windows.old"
@matthiasbaldi
matthiasbaldi / readme.md
Last active August 24, 2021 14:58
Tips & Tricks -> Just Remind it.

Angular

  • Wrapper for format and number pipes, for better maintainability
  • Use projections instead of working with *ngIf in template or with methods

Accessibility

  • Use a screenrreader as validation and in the development process
  • Good accessibility is also positiv for a good HTML dom and SEO
  • Respect contrast and visualize focus
@matthiasbaldi
matthiasbaldi / revokeTraefik2Cert.sh
Created October 22, 2019 17:14
Traefik 2.0 revoke Let's Encrypt cerificate
#!/usr/bin/env bash
# credits: https://github.com/containous/traefik/issues/635#issuecomment-400423859
# usage: revokeCert.sh {yourDomainToRevoke}
# the JSON path changed a bit compared with Traefik v1
set -e
ACME_FILE=/traefik/path/traefik/acme.json # change
jq -r ".default.Certificates | .[] | select(.domain.main == \"$1\").key" < $ACME_FILE | base64 --decode > /tmp/a.key
@matthiasbaldi
matthiasbaldi / app.module.ts
Created September 23, 2019 09:02
Deep Angular Filter-Pipe
// this file has to look something like this...
import {NgModule,} from '@angular/core';
import { MyComponent } from './my.component';
import { FilterPipe } from './filter.pipe';
@NgModule({
declarations: [
MyComponent
@matthiasbaldi
matthiasbaldi / squash-commits.sh
Created April 3, 2019 08:04
GIT squash a PR to one commit
# the hash describes the commit you want to go back
git reset --soft <hash>
git commit -m "<message>"
git push