Skip to content

Instantly share code, notes, and snippets.

View douglarek's full-sized avatar
💭
Acting cool, do not disturb

douglarek

💭
Acting cool, do not disturb
View GitHub Profile
$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.7.0
@douglarek
douglarek / install-openjdk.txt
Last active March 5, 2025 20:04
How to install openJDK 11 on macOS
$ curl -C - https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz -O openjdk-11_osx-x64_bin.tar.gz
$ tar xf openjdk-11_osx-x64_bin.tar.gz
$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/
$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
@douglarek
douglarek / ksql-server.properties
Created May 16, 2018 08:12
Recommended KSQL Production Settings
# Set the retries to Integer.MAX_VALUE to ensure that transient failures
# will not result in data loss.
ksql.streams.producer.retries=2147483647
# Set the batch expiry to Long.MAX_VALUE to ensure that queries will not
# terminate if the underlying Kafka cluster is unavailable for a period of
# time.
ksql.streams.producer.confluent.batch.expiry.ms=9223372036854775807
# Allows more frequent retries of requests when there are failures,
@douglarek
douglarek / sample.rst
Created April 21, 2018 04:36 — forked from tatsuhiro-t/sample.rst
h2load against gRPC greeter_server

command-line:

$ h2load http://localhost:50051/helloworld.Greeter/SayHello \
      -d grpc-upload \
      -H 'te: trailers'
      -H 'content-type: application/grpc'
      -n1000000 -c100 -m100

Create grpc-upload file using following python script:

package main
import "encoding/json"
// jsonText comes from http://json.org/example.html
var jsonText = []byte(`
{
... // 此处省略, 同上
}`)
package main
import "encoding/json"
// jsonText comes from http://json.org/example.html
var jsonText = []byte(`
{
"glossary":{
"title":"example glossary",
"GlossDiv":{
@douglarek
douglarek / spacemacs-cheshe.md
Created March 23, 2018 00:30 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
package main
import (
"log"
"time"
"golang.org/x/sys/unix"
)
func main() {
@douglarek
douglarek / main.go
Created November 13, 2017 02:23
A Tour of Go - Exercise: Web Crawler Raw
package main
import (
"fmt"
"sync"
)
// Fetcher ...
type Fetcher interface {
// Fetch returns the body of URL and
@douglarek
douglarek / exercise.tour.go
Created November 12, 2017 08:26 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)