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 / custom-route-serializer.ts
Created November 8, 2019 16:34
Use this in any effect
import { Params, RouterStateSnapshot, Data } from '@angular/router';
import { RouterStateSerializer, BaseRouterStoreState } from '@ngrx/router-store';
export interface RouterStateWithData<T> extends BaseRouterStoreState {
url: string;
params: Params;
// queryParams: Params;
data: T;
}
📝Blogged: ngx-semantic-version: enhance your git and release workflow for 🅰️ #Angular by our guest author @d_koppenhagen. 🚀
https://angular.schule/blog/2019-11-ngx-semantic-version
Save a lot of time and automatically…
💎 lint messages
⛏ hook into git lifecycle
📦 bump releases
📖 generate CHANGELOG files
@JohannesHoppe
JohannesHoppe / Remove HP Product Research.md
Last active October 29, 2019 11:25
Remove HP Product Research

/Library/Printers/hp/Utilities/HPPU Plugins/ProductImprovementStudy.hptask/Contents/Helpers/HP Product Research Manager.app

Just move it to the trash.

@JohannesHoppe
JohannesHoppe / docker_stop_remove_all.md
Created October 18, 2019 09:02
Stop / remove all Docker containers

One liner to stop / remove all of Docker containers:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@JohannesHoppe
JohannesHoppe / swallowError.operator.ts
Created June 8, 2019 05:14
Quick and dirty reaction to rxjs errors
import { OperatorFunction, EMPTY } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { ErrorDisplayService } from './error-display.service';
export function swallowError<T>(): OperatorFunction<T, T> {
return catchError(() => (EMPTY));
}
export function swallowErrorWithDisplay<T>(eds: ErrorDisplayService): OperatorFunction<T, T> {
return catchError(err => {
@JohannesHoppe
JohannesHoppe / boostrap4-display-utilities.csv
Created April 5, 2019 14:28
Boostrap 4 Display utilities
Old New
.hidden .d-none
.hidden-xs-up .d-none
.hidden-xs .d-none .d-sm-[value]
.visible-xs .d-sm-none
.visible-xs-block .d-block .d-sm-none
.visible-xs-inline .d-inline .d-sm-none
.visible-xs-inline-block .d-inline-block .d-sm-none
.hidden-xs-down .d-none .d-sm-[value]
.hidden-sm .d-sm-none .d-md-[value]
@JohannesHoppe
JohannesHoppe / access-mac-localhost-from-parallels-desktop-ie-edge.md
Created April 4, 2019 15:05
Accessing macOS localhost from Parallels Desktop IE or Edge

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

@JohannesHoppe
JohannesHoppe / How to Restart Mac OS X Mission Control and Dock.md
Created April 1, 2019 20:07
How to Restart Mac OS X Mission Control and Dock

If you are having problems on your Mac with the Dock or the Mission Control feature, you can simply restart both by:

killall Dock
@JohannesHoppe
JohannesHoppe / Compress PDF mac.md
Last active March 20, 2019 12:11
Compress PDF mac

https://apple.stackexchange.com/a/33750

ColorSync Utility is what your looking for. For me the standard compression was also too little resolution & too lossy compression. So I created a new filter in ColorSync - which then becomes available in e.g. Preview: Resolution 200 dpi, jpeg quality ~75%

Step 1: Open ColorSync Utility & create the new filter such as below

![Screenshot: New ColorSync filter][2]

The above settings give me files with acceptable size and decent quality (e.g. for sending by e-mail)

@JohannesHoppe
JohannesHoppe / angular.zsh-theme
Last active March 8, 2019 11:13
angular.zsh-theme
#
# Modified Cobalt2 Theme - https://github.com/wesbos/Cobalt2-iterm
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
##
### Segment drawing
# A few utility functions to make it easy and re-usable to draw segmented prompts