Skip to content

Instantly share code, notes, and snippets.

View otakijae's full-sized avatar
🦈

otakijae otakijae

🦈
View GitHub Profile
@otakijae
otakijae / CSharpMySQLConnection.cs
Created April 21, 2018 11:25
C#MySQLConnection
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
namespace LecturePractice
{
@otakijae
otakijae / ReadExcelFile.cs
Last active May 31, 2018 01:42
C#ReadExcelFile
using System;
using Excel = Microsoft.Office.Interop.Excel;
namespace LecturePractice
{
class Program
{
static void Main(string[] args)
{
try
@otakijae
otakijae / example.go
Created April 29, 2020 04:20
[Golang] io.Pipe
// Pipe creates a synchronous in-memory pipe.
// It can be used to connect code expecting an io.Reader
// with code expecting an io.Writer.
// Reads on one end are matched with writes on the other,
// copying data directly between the two; there is no internal buffering.
// It is safe to call Read and Write in parallel with each other or with
// Close. Close will complete once pending I/O is done. Parallel calls to
// Read, and parallel calls to Write, are also safe:
// the individual calls will be gated sequentially.
@otakijae
otakijae / ping.go
Last active October 10, 2022 14:06
send http2 ping frame
func (w *HttpBo)Ping(network, address string) error {
if transport, ok := w.Client.Transport.(*http2.Transport); !ok {
return errors.New("Getting HTTP2 Client Transport failed")
} else {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
conn, err := tls.Dial(network, address, &tls.Config{NextProtos: []string{http2.NextProtoTLS}})
if err != nil {
return err