Skip to content

Instantly share code, notes, and snippets.

0x8F6980AF09acD1c309E16B02dd5C4b36fB4a8957
0xb8429a61406d53e47f4287f6d5f9b255dc227907
@matishsiao
matishsiao / slack.php
Created February 24, 2017 08:21 — forked from uberswe/slack.php
Post updates to Slack with 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
@matishsiao
matishsiao / pipe.go
Last active March 4, 2024 11:59
named pipe sample code
package main
import (
"bufio"
"fmt"
"log"
"os"
"syscall"
"time"
)
@matishsiao
matishsiao / FIFOQueue.go
Last active July 6, 2016 10:04
Golang FIFO Queue Example
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 / reverse_proxy.go
Last active April 17, 2024 13:24
how to use reverse proxy(http/https)
package main
import (
"net/http"
"net/http/httputil"
"net/url"
"time"
"net"
"log"
"fmt"
"crypto/tls"
@matishsiao
matishsiao / timeformat.go
Last active August 29, 2015 14:28
Go time format like PHP time format
package main
import (
"fmt"
"strings"
"time"
)
func main() {
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@matishsiao
matishsiao / proxy.go
Last active August 29, 2015 14:11 — forked from vmihailenco/proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"