Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Benedikt Gregor scsskid

🌴
On vacation
View GitHub Profile
@scsskid
scsskid / nginx-reverse-proxy.md
Last active Sep 15, 2021
Nginx Reverse Proxy Config Docker Wordpress #ubuntu #docker #nginx
View nginx-reverse-proxy.md

Nginx Reverse Proxy

Sample Config from wordpress project

server {
  listen        80;
  server_name   v2.benedikt.gr;

 location / {
@scsskid
scsskid / tools.md
Last active Sep 12, 2021
network-tools
View tools.md
View inline-svg-function.scss
// Replace letters
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
@scsskid
scsskid / README.md
Last active Sep 1, 2021 — forked from sutlxwhx/README.md
How to backup your LAMP / LEMP installation the right way #bash #ubuntu
View README.md

Introduction

This is the LAMP / LEMP environment backup guide in case you want or need to try my highload LEMP installation.

Basic usage

As a first thing we will setup a variable that will store current date and time. We will use year-month-day_hours-minutes-seconds format:

now=$(date +"%Y-%m-%d_%H-%M-%S")
@scsskid
scsskid / run-pg-pgadmin.sh
Created Aug 14, 2021
[Temp Spin Up pg and pgadmin in Docker] #docker #bash
View run-pg-pgadmin.sh
docker pull postgres
docker pull dpage/pgadmin4
docker run \
--name temppg \
--net database_default \
-p 54332:5432 \
-e 'POSTGRES_USER=root' \
-e 'POSTGRES_PASSWORD=root' \
-e 'POSTGRES_DB=testtest' \
@scsskid
scsskid / git-disable-pager.md
Last active Sep 1, 2021
git disable default pager config | #git
View git-disable-pager.md

Disable Pager

for git diff or other commands
--global is optional

git config --global pager.diff false
@scsskid
scsskid / postgres.md
Last active Sep 1, 2021
Postgres Cheatsheet #postgres #ubuntu
View postgres.md

psql

Connect to Database

\c [databasename]
View getCurrentUrl.js #helpers
//src: https://github.com/swup/swup/blob/master/src/helpers/getCurrentUrl.js
const getCurrentUrl = () => {
return window.location.pathname + window.location.search;
};
export default getCurrentUrl;
@scsskid
scsskid / getDataFromHtml.js
Last active Sep 1, 2021
[getDataFromHtml] #dom #helpers
View getDataFromHtml.js
//Src: https://github.com/swup/swup/blob/master/src/helpers/getDataFromHtml.js
import { queryAll } from '../utils';
const getDataFromHtml = (html, containers) => {
let fakeDom = document.createElement('html');
fakeDom.innerHTML = html;
let blocks = [];
for (let i = 0; i < containers.length; i++) {
@scsskid
scsskid / docker-personal-cheatsheet.md
Last active Sep 2, 2021
Docker Personal Cheatcheet | #bash #docker
View docker-personal-cheatsheet.md

Docker Personal Cheatsheet

remove all containers

docker rm -f $(docker ps -aq)

Testing Single Containers without compose