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 / angular.zsh-theme
Created March 8, 2019 11:13
angular.zsh-theme
#
# 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
@JohannesHoppe
JohannesHoppe / apache.sh
Last active December 10, 2018 22:42
start, stop or restart Apache from the console terminal in Mac OS X
# To start httpd:
sudo /usr/sbin/apachectl start
# To stop httpd:
sudo /usr/sbin/apachectl stop
# To restart httpd:
sudo /usr/sbin/apachectl restart
# quick start
@JohannesHoppe
JohannesHoppe / wicnred-manage-stored-credentials.cmd
Created September 28, 2018 09:05
Windows: manage stored credentials (wincred)
rundll32.exe keymgr.dll, KRShowKeyMgr
@JohannesHoppe
JohannesHoppe / what-is-my-ip.js
Created September 26, 2018 11:09
What is my ip?
const express = require('express');
const app = express();
var port = process.env.port || 8080;
app.get('/', (req, res) => res.send('Hello stranger! <a href="/ip">Click here</a>'));
app.get('/ip', (req, res) => {
let ip = (req.headers['x-forwarded-for'] || '').split(',').pop() ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||

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 / 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 / swagger_codegen_build_angular_api_client.sh
Created April 5, 2018 09:51
Swagger-codegen: buil angular_api_client from source
mvn clean package && \
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l typescript-angular \
-o /var/tmp/angular_api_client
@JohannesHoppe
JohannesHoppe / install_java_8.sh
Last active April 5, 2018 08:57
Install Java 8 for swagger-codegen
brew cask install caskroom/versions/java8
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export PATH=${JAVA_HOME}/bin:$PATH
java -version
@JohannesHoppe
JohannesHoppe / portfolioManager_pingpong.js
Created March 25, 2018 13:03 — forked from bitkominer/portfolioManager_pingpong.js
To be saved inside folder "/plugins/trader/" as supplemental files for pingpong strategy
/*
The portfolio manager is responsible for making sure that
all decisions are turned into orders and make sure these orders
get executed. Besides the orders the manager also keeps track of
the client's portfolio.
NOTE: Execution strategy is limit orders (to not cross the book)
*/
@JohannesHoppe
JohannesHoppe / git_clone.cmd
Created March 13, 2018 10:32
Obtaining Kendo-Angular Source Code
git clone https://kendo.git.progress.com/kendo-angular-buttons.git
git clone https://kendo.git.progress.com/kendo-angular-charts.git
git clone https://kendo.git.progress.com/kendo-angular-dateinputs.git
git clone https://kendo.git.progress.com/kendo-angular-dialog.git
git clone https://kendo.git.progress.com/kendo-angular-dropdowns.git
git clone https://kendo.git.progress.com/kendo-angular-excel-export.git
git clone https://kendo.git.progress.com/kendo-angular-grid.git
git clone https://kendo.git.progress.com/kendo-angular-inputs.git
git clone https://kendo.git.progress.com/kendo-angular-intl.git
git clone https://kendo.git.progress.com/kendo-angular-label.git