Skip to content

Instantly share code, notes, and snippets.

@matishsiao
matishsiao / proxy.go
Last active August 29, 2015 14:11 — forked from vmihailenco/proxy.go
View proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
View ssh_client.go
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@matishsiao
matishsiao / timeformat.go
Last active August 29, 2015 14:28
Go time format like PHP time format
View timeformat.go
package main
import (
"fmt"
"strings"
"time"
)
func main() {
@matishsiao
matishsiao / FIFOQueue.go
Last active July 6, 2016 10:04
Golang FIFO Queue Example
View FIFOQueue.go
package main
import (
"fmt"
)
var queue_front int64 = 0
var queue_rear int64 = 0
var queue_init bool = false
var queue_size int64 = 0
@matishsiao
matishsiao / slack.php
Created February 24, 2017 08:21 — forked from uberswe/slack.php
Post updates to Slack with PHP
View slack.php
$message = "Hello this is a test!"; // The message you would like to send
$parameters = array(
'channel' => 'testing', // Simply type your channel name, make sure your bot is invited
'text' => html_entity_decode($message), // Good idea to decode
'as_user' => 'true');
// Use groups.list if you run into channel_not_found issues with private channels, make sure your bot is invited
$url = "https://slack.com/api/"."chat.postMessage"; // chat.postMessage is the method
$parameters['token'] = "MY-API-TOKEN"; // replace MY-API-TOKEN with the API Token for your bot
View account-test
0xb8429a61406d53e47f4287f6d5f9b255dc227907
View account-eth
0x8F6980AF09acD1c309E16B02dd5C4b36fB4a8957
@matishsiao
matishsiao / pipe.go
Last active December 13, 2022 21:46
named pipe sample code
View pipe.go
package main
import (
"bufio"
"fmt"
"log"
"os"
"syscall"
"time"
)
@matishsiao
matishsiao / reverse_proxy.go
Last active March 11, 2023 23:50
how to use reverse proxy(http/https)
View reverse_proxy.go
package main
import (
"net/http"
"net/http/httputil"
"net/url"
"time"
"net"
"log"
"fmt"
"crypto/tls"