Skip to content

Instantly share code, notes, and snippets.

@thegeekyasian
thegeekyasian / HttpRequestLoggingFilter.java
Created February 25, 2020 10:58
Spring Boot HttpServletRequest Logging Filter. A Request Logging Filter for Spring Boot applications, that allows you to read the request body multiple times. The request body is cached using an overridden HttpServletRequestWrapper. Then a reader that allows the client to read the body multiple times is returned.
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StreamUtils;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.*;
import java.util.*;
@lohenyumnam
lohenyumnam / How to use CoreLocation in iOS using Swift 4.swift
Last active May 21, 2024 11:26
How to use CoreLocation in iOS using Swift 4 to get your location Speed, Floor, timestamp, Course Direction, Altitude above sea level
// How to use CoreLocation to get your location Speed, Floor, timestamp, Course Direction, Altitude above sea level
//TODO: Step 1 ####################################################################
// First of all import "CoreLocation"
import CoreLocation
//TODO: Step 2 ####################################################################

E DAJE

Ci hai creduto davvero???? Ma io che ne so'!!!

Se lo sapevo lo dicevo a te???

Se hai cliccato lascia un TUO commento nel muro della vergogna

@ruanbekker
ruanbekker / docker-nfs-volumes.md
Created December 10, 2017 10:43
NFS Volumes with Docker Swarm

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@wojteklu
wojteklu / clean_code.md
Last active May 21, 2024 11:23
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active May 21, 2024 11:22
A guide to replacing the deprecated `seaborn.distplot` function.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@silicakes
silicakes / zellij_sessionizer
Last active May 21, 2024 11:22
zellij_sessionizer
#!/usr/bin/env bash
# Inspired by https://github.com/ThePrimeagen/.dotfiles/blob/602019e902634188ab06ea31251c01c1a43d1621/bin/.local/scripts/tmux-sessionizer
# Just for zellij
# alows you to use `fzf` to navigate into a desire folder and either start or attach into a zellij session
# If you run it from inside zellij, it will open the newly selected folder in a new pane
# Demo of the original: https://youtu.be/bdumjiHabhQ?t=269
# 1. Place the script in your path
@ih2502mk
ih2502mk / list.md
Last active May 21, 2024 11:19
Quantopian Lectures Saved
@kekru
kekru / 01nginx-tls-sni.md
Last active May 21, 2024 11:19
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled

WebCatalog is a tool to easily create desktop apps from websites. It's an awesome tool, but the free version (Basic account) limits you to 5 apps.

webcatalog5applimitation

However, I came up with a simple workaround to trick WebCatalog into letting you install as many apps as you want:

All WebCatalog apps are stored at %LocalAppData%\Programs\WebCatalogApps. On startup, WebCatalog makes a list of your installed apps by looking at this folder. If we make it so WebCatalog cannot find this folder, it won't think we have any apps installed, and it will let us install more.