Skip to content

Instantly share code, notes, and snippets.

View hihanley's full-sized avatar
😋
Focusing

hihanley

😋
Focusing
View GitHub Profile
@hihanley
hihanley / profile.ps1
Created September 23, 2022 08:15
PowerShell Complete
Import-Module PSReadLine
# Shows navigable menu of all options when hitting Tab
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
# Autocompleteion for Arrow keys
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
$PSReadLineOptions = @{
@hihanley
hihanley / ip.go
Created February 9, 2022 07:18
查询出口 IP 的小服务
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"net/http"
"sync"
"time"
@hihanley
hihanley / demo.java
Created January 18, 2022 19:30
Java retrofit2 请求设置代理
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import lombok.Data;
import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.jackson.JacksonConverterFactory;
import retrofit2.http.GET;
@hihanley
hihanley / demo.java
Last active September 5, 2023 10:56
Java okhttp 请求设置代理
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import okhttp3.OkHttpClient;
import okhttp3.Request;
public class Demo{
public static void main(String[] args) throws IOException {
var proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 1080));
var client = new OkHttpClient.Builder().proxy(proxy).build();