Skip to content

Instantly share code, notes, and snippets.

View edwardzjl's full-sized avatar
🦝

Junlin Zhou edwardzjl

🦝
View GitHub Profile
@gavinhungry
gavinhungry / nginx-tls.conf
Last active June 13, 2025 19:54
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <[email protected]>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@bennAH
bennAH / mux_handlers.go
Created October 18, 2015 21:36
gorilla mux - multiple handlers
package main
import (
"fmt"
"github.com/gorilla/mux"
"net/http"
)
func main() {
r := mux.NewRouter()
@mikecroucher
mikecroucher / toree_on_ubuntu_16.04.md
Last active December 30, 2018 13:59
Installing Toree+Spark 2.1 on Ubuntu 16.04

Installing Toree+Spark 2.1 on Ubuntu 16.04

## 23rd January 2017

At the time of writing, the pip install of toree is not compatible with spark 2.x. We need to use the master branch from git.

Requirements

sudo apt install openjdk-8-jdk-headless
@claraj
claraj / gist:3b2b95a62c5ba6860c03b5c737c214ab
Created April 12, 2017 21:34
Custom JSON encoder for Flask
from flask import Flask
from flask import render_template
from flask import request
from flask import jsonify
import json
# This class tells Python how to turn a Delivery object into a JSON string.
# This class could encode various types of objects - use isinstance to check what type of thing it is, and return the appropriate JSON
# https://docs.python.org/3/library/json.html
@pitrk
pitrk / _mock_file_with_string.md
Last active November 28, 2024 21:12
Mock file with string in Python

Mock file with string in Python

This is an example on how to mock a file with string.

Use case

Testing a function which opens a file and does some kind of operation on it.

About the example

@Tamal
Tamal / git-ssh-error-fix.sh
Last active July 22, 2025 16:12
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@skinnay-dev
skinnay-dev / hunter-bis-alli.md
Last active May 6, 2025 06:50
Skinnay's Classic Hunter Gear lists (Alliance)

Skinnay's Classic Hunter Gear Lists (Alliance)

  • "True" BiS is the absolute best gear configuration given all the possible options. Often this doesn't give you a great picture of what you should be striving for, so realistic alternative sets are provided to plan for constraints that can occur with typical loot distribution.
  • Stat weights and dps values are based on Sixx's DPS sheet assuming full buffs, consumables, and boss debuffs with 20/31/0 spec, unless otherwise specified. These are of course subject to change with different variables.
  • Gear lists are based on their general effectiveness against all raid bosses as opposed to being tailored for specific bosses, unless otherwise specified.

Table of Contents

Two approaches to handle error responses from Spring WebClient calls globally:

  • Exceptions with webclients are all wrapped in WebClientResponseException class. So we can handle that using Spring's ExceptionHandler annotation.

  • Using ExchangeFilterFunction while constructing the webclient bean.

@cbuckowitz
cbuckowitz / README.md
Last active February 23, 2025 18:42
Change Storage Location for Docker Desktop with WSL2 #DockerDesktop #WSL2

Change the Storage Location for Docker Desktop with WSL2

Docker Desktop stores docker data in 2 distros

  • docker-desktop
  • docker-desktop-data

These distros are installed on the system drive by default.

To move them to another drive, these distros can be exported, deleted and imported from the new location.