Skip to content

Instantly share code, notes, and snippets.

View junxie6's full-sized avatar
🐢
Push the limits of what's possible. Today.

Jun Hsieh junxie6

🐢
Push the limits of what's possible. Today.
View GitHub Profile
@junxie6
junxie6 / announce.php
Created January 20, 2020 04:25 — forked from nsuan/announce.php
Bitstorm Tracker
<?php
/*
* Bitstorm - A small and fast Bittorrent tracker
* Copyright 2008 Peter Caprioli
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@junxie6
junxie6 / bobp-python.md
Created February 6, 2020 05:43 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@junxie6
junxie6 / introrx.md
Created March 22, 2020 17:56 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@junxie6
junxie6 / rxjs-diagrams.md
Created April 10, 2020 02:13 — forked from PCreations/rxjs-diagrams.md
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@junxie6
junxie6 / http_streaming.md
Created August 22, 2020 06:12 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@junxie6
junxie6 / go-syslog-octet-couting-stream.go
Created September 6, 2020 00:11 — forked from leodido/go-syslog-octet-couting-stream.go
Usage example of go-syslog to parse a stream of syslog messages with octet-counting framing
package main
import (
"io"
"time"
"github.com/davecgh/go-spew/spew"
syslog "github.com/influxdata/go-syslog/v2"
"github.com/influxdata/go-syslog/v2/octetcounting"
)
@junxie6
junxie6 / channels.go
Created September 6, 2020 16:41 — forked from quasilyte/channels.go
Channel vs mutex vs atomic for synchronized counter
package benchmark
import (
"context"
"runtime"
"sync"
"sync/atomic"
"testing"
"time"
)
@junxie6
junxie6 / net-test.go
Created September 15, 2020 16:02 — forked from vys/net-test.go
A simple client and server with lots of connections in GO. Testing GO's network connection handling.
package main
import (
"flag"
// "fmt"
"github.com/vys/go-humanize"
"io"
"log"
"net"
//"net/http"
@junxie6
junxie6 / httpsproxy.go
Last active September 23, 2020 21:24 — forked from wwek/httpsproxy.go
https proxy in golang
// https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c
// #!/usr/bin/env bash
// case `uname -s` in
// Linux*) sslConfig=/etc/ssl/openssl.cnf;;
// Darwin*) sslConfig=/System/Library/OpenSSL/openssl.cnf;;
// esac
// openssl req \
// -newkey rsa:2048 \
// -x509 \
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error