Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"net/http"
"time"
)
func test(o time.Time) {
c := &http.Client{}
@colindev
colindev / main.go
Last active December 18, 2015 07:57
go channal and routine
package main
import (
"fmt"
"strconv"
"strings"
"time"
)
func main() {
@colindev
colindev / pcntl-example.php
Last active November 27, 2017 08:07
demo for php pcntl
<?php
foreach (['a', 'b', 'c'] as $x) {
$pid = pcntl_fork();
if ($pid === -1) {
echo 'fork Error';
} elseif (!$pid) {
$i = 0;
while (true) {
$t = time();
echo "sub(${x}, ${i}) ${t}\n";
@colindev
colindev / client.go
Created April 6, 2020 09:00 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)