Skip to content

Instantly share code, notes, and snippets.

View Hccake's full-sized avatar
🙀
Growing fat

有猫饼 Hccake

🙀
Growing fat
View GitHub Profile
@Hccake
Hccake / ObjectHeader32.txt
Created September 19, 2023 17:19 — forked from arturmkrtchyan/ObjectHeader32.txt
Java Object Header
|----------------------------------------------------------------------------------------|--------------------|
| Object Header (64 bits) | State |
|-------------------------------------------------------|--------------------------------|--------------------|
| Mark Word (32 bits) | Klass Word (32 bits) | |
|-------------------------------------------------------|--------------------------------|--------------------|
| identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal |
|-------------------------------------------------------|--------------------------------|--------------------|
| thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased |
|-------------------------------------------------------|--------------------------------|--------------------|
|
@Hccake
Hccake / socks5_proxy.go
Created August 2, 2022 08:30 — forked from ometa/socks5_proxy.go
Golang HTTP Client using SOCKS5 proxy and DialContext
// Golang example that creates an http client that leverages a SOCKS5 proxy and a DialContext
func NewClientFromEnv() (*http.Client, error) {
proxyHost := os.Getenv("PROXY_HOST")
baseDialer := &net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}
var dialContext DialContext
@Hccake
Hccake / .gradle
Created September 10, 2021 08:07
gradle maven publish change artifactory runtime scope to compile scope
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
// change scope
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.implementation.allDependencies.find { dep ->
dep.name == it.artifactId.text()