Skip to content

Instantly share code, notes, and snippets.

@nemoinho
nemoinho / bash-prompt-for-git.sh
Last active November 21, 2016 23:41
Just my bash-prompt
#!/usr/bin/env bash
# debian, ubuntu and so on
GIT_PROMPT_SH=/usr/lib/git-core/git-sh-prompt
# newtons vegetable with brew installed
if [ ! -d $(dirname $GIT_PROMPT_SH) ]; then
GIT_PROMPT_SH=/usr/local/etc/bash_completion.d/git-prompt.sh
fi
@nemoinho
nemoinho / .bash_alias
Last active March 7, 2017 10:03
bash alias
alias lg='git lg'
alias co='git checkout'
alias push='git push'
alias commit='git commit'
alias st='git status'
alias gd='git diff'
alias gdc='gd --cached'
@nemoinho
nemoinho / inheritance.js
Last active May 24, 2017 13:08
Example of how to implement JS-Inhertiance
function BaseClass(param1) {
this.param1 = param1;
}
BaseClass.prototype.logParam1 = function(){
console.log(this.param1);
};
BaseClass.prototype.log = function () {
this.logParam1();
@nemoinho
nemoinho / README.md
Last active July 12, 2017 16:47
This script will provide an "on typing" search-filter for the zoho-vault. The script will only filter the displayed secrets by their names and descriptions and only for the few visible letters of these fields.

Intuitive Zoho-filter

This script will provide an "on typing" search-filter for the zoho-vault. The script will only filter the displayed secrets by their names and descriptions and only for the few visible letters of these fields.

Requirements

  • Tampermonkey (Chrome)
  • Greasemonkey (Firefox)

Installation

Just click the link to run the Installation.

@nemoinho
nemoinho / npm
Last active January 19, 2018 00:04
npm-client for IntelliJ
#!/usr/bin/env bash
# Replace everything before the actual command
# by replacing everything until we found a string with npm-cli.js inside
while [ $1 == ${1/npm-cli.js/} ]; do shift; done
shift
COMMAND="HOME=/user yarn $@"
case $(uname) in
Linux)
#!/usr/bin/env sh
host=$1
port=$2
if [ -n "$port" ] && [ "$port" != "22" ]; then
ssh-keygen -F [$host]:$port 2>/dev/null >/dev/null || ssh-keyscan -p $port $host 2>/dev/null >> $HOME/.ssh/known_hosts
else
ssh-keygen -F $host 2>/dev/null >/dev/null || ssh-keyscan $host 2>/dev/null >> $HOME/.ssh/known_hosts
fi
@nemoinho
nemoinho / gitea-split-view-improvements.user.js
Last active August 10, 2018 13:37
Gitea Split-view-improvement
// ==UserScript==
// @name Gitea Split-view-improvement
// @description This script spreads the split-view of gitea to the whole available space to reduce the problems of too short lines.
// @version 1.0.0
// @author Felix Nehrke
// @include /^https:\/\/gitea\.[^\/]+\/.*\/pulls\/\d+\/files.*/
// @downloadURL https://gist.github.com/nemoinho/655f93745bba44cee7e91abe79628f2e/raw/gitea-split-view-improvements.user.js
// @updateURL https://gist.github.com/nemoinho/655f93745bba44cee7e91abe79628f2e/raw/gitea-split-view-improvements.user.js
// @grant none
// ==/UserScript==
@nemoinho
nemoinho / CI-CD Tools Vergleich.md
Last active June 19, 2019 11:56
Auf dieser Seite werden ein paar CI & CD Tools vorgestellt und verglichen, wobei ein besonderes Augenmerk darauf gelegt wird, für welche Anforderungen sie sich besonders eignen.

Systematik

Die Systeme können grundsätzlich in 2 Kategorieren eingeordnet werden, die signifikaten Einfluss auf die Komplexität des resultierenden Setups haben. Zum einen gibt es gescriptete Lösungen, wobei hier von einfach Shell-Scripten bis zu ganzen Scriptsprachen für den Build-Service vieles anzutreffen ist und zum Anderen gibt es deklarative Ansätze, welche meist auf yaml oder anderen Menschenlesbaren Beschreibungssprachen basieren. Des weiteren muss beachtet werden, ob die Systeme gehostet sind, oder ob einem der Betrieb selbst obliegt. Darüber hinaus eignet sich nicht jedes Tools für alle möglichen Anwendungsfälle, weshalb unterschieden werden kann, ob das Systeme allgemeine Anwedungsfälle abbilden kann oder eher für spezielle Anwedungsfälle optimiert ist.

Kandidaten

@nemoinho
nemoinho / Gnome-HIDPI.md
Last active July 19, 2019 08:52
Gnome for HIDPI and weird resolutions

Manage weird gnome settings

Gnome tries to detect HIDPI screens and try to help the user by scaling them. This behavior is quite annoying if you have a setup with a big external screen and a small notebook screen with a high resolution.

This document collects my solution to solve this problem.

Solution

@nemoinho
nemoinho / S3-and-API-Gateway-in-Cloudfront.md
Last active July 27, 2019 12:07
Deploy a S3-Frontend and an API-Gateway behind a Cloudfront-CDN

Architecture

We want to deploy a Cloudfront CDN which is available through a Domain managed by Route53. Through this CDN we want to deliver a Website which is split up into static frontend and a dynamic backend. The frontend is served by a S3-bucket and provides a low cost by high reliable setup. The backend on the other hand is described by an API-Gateway which calls several services in the backend such as Lambda or DynamoDB.

Diagramm of the Architecture

Best practices and advisories

We try follow a best practices for this project to allow make the setup as streamlined and useful for other projects as possible.