Skip to content

Instantly share code, notes, and snippets.

View songrgg's full-sized avatar
🎯
Focusing

Songrong Jiang songrgg

🎯
Focusing
View GitHub Profile
@songrgg
songrgg / gist:fd7deeb65cd7eb3b581e69ff68a1ab75
Created March 17, 2022 13:56 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
public class Main {
public static void main(String[] args) throws InterruptedException {
Thread.sleep(100000);
System.out.println("Goodbye, World!");
}
}
@songrgg
songrgg / istio.go
Last active October 28, 2018 09:52
go-micro's istio selector, for service registry.
package istio
import (
"fmt"
"strings"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/selector"
)
@songrgg
songrgg / Main.java
Created November 18, 2017 16:04
Jetty HTTP2
package com.wallstreetcn.flume.source.http;
import org.eclipse.jetty.alpn.ALPN;
import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory;
import org.eclipse.jetty.http2.HTTP2Cipher;
import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.ssl.SslContextFactory;
@songrgg
songrgg / concurrent_api.go
Last active July 3, 2017 01:48
Call API1 & API2 concurrently
package main
import (
"fmt"
"sync"
)
func main() {
var wt sync.WaitGroup
wt.Add(2)
package main
import "time"
var metrics chan string
const (
THRESHOLD int = 100
BUFFER_SIZE int = 1000
)
FROM alpine:3.5
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN apk add --update ca-certificates openssl && update-ca-certificates
RUN apk add --update curl tcpdump
RUN apk add --update curl iftop
RUN apk add --update strace
RUN apk add --update tzdata
RUN apk add --update bash && rm -rf /var/cache/apk/*
@songrgg
songrgg / gist:89e10891f7a3f873bc7d
Created June 30, 2015 16:16
zend_long definition
// zend_long.h
/* This is the heart of the whole int64 enablement in zval. */
#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
# define ZEND_ENABLE_ZVAL_LONG64 1
#endif
#ifdef ZEND_ENABLE_ZVAL_LONG64
typedef int64_t zend_long;
#else
typedef int32_t zend_long;