Skip to content

Instantly share code, notes, and snippets.

View ego008's full-sized avatar
🏠
Working from home

Ybb ego008

🏠
Working from home
View GitHub Profile
@ego008
ego008 / routeros-ddns-dnspod.sh
Created June 13, 2023 14:07 — forked from shenjunru/routeros-ddns-dnspod.sh
DNSPod DDNS Updater on RouterOS
#policy: read,test
#pppoe-interface
:local pppoe "pppoe-out1"
#dnspod-token
:local token "uid,api-toekn"
#dnspod-domain
:local domain "example.com"
@ego008
ego008 / Golang_Slice_Contains_Benchmark.go
Created May 19, 2022 02:44
Golang Slice Contains Benchmark
package main
import (
"fmt"
"strconv"
"testing"
)
/**
@author: golangNote
h1 {
font-size: 1.25em;
}
h2 {
font-size: 1.125em;
}
h3 {
font-size: 1.05em;
package main
import (
"fmt"
"github.com/julienschmidt/httprouter"
"log"
"net/http"
)
// The type of our middleware consists of the original handler we want to wrap and a message
@ego008
ego008 / autocert.go
Created March 31, 2022 08:02 — forked from NHOrus/autocert.go
Currently cobbled autocerted file server thingy
package main
import (
"crypto/tls"
"fmt"
"golang.org/x/crypto/acme/autocert"
"io"
"log"
"net/http"
"time"
@ego008
ego008 / socks5_proxy.go
Created November 20, 2021 07:53 — forked from felix021/socks5_proxy.go
Minimal socks5 proxy implementation in Golang
package main
import (
"encoding/binary"
"errors"
"fmt"
"io"
"net"
)
@ego008
ego008 / mql Modify Open Order.mq4
Created October 21, 2021 02:22 — forked from matthewkastor/mql Modify Open Order.mq4
function that moves the stop loss and take profit levels if it is favorable to the open position on metatrader 4
// select the order http://docs.mql4.com/trading/orderselect
// OrderSelect(......
// then this method will work on the order selected
// bool result = ModifyOpenOrder(0.00300, 0.00900);
// returns true if the order was modified successfully
// returns false if the order didn't need modification or if modification failed
bool ModifyOpenOrder(double stopLossPips, double pipsProfit){
bool modify = false;
double takeProfit;
@ego008
ego008 / animatedScrollTo.js
Created March 12, 2021 16:59 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@ego008
ego008 / main.go
Created February 6, 2021 03:12 — forked from Equim-chan/main.go
Golang net/http X-Response-Time header middleware
package main
import (
"fmt"
"log"
"net/http"
"time"
"httptimer"
)
@ego008
ego008 / main.go
Created February 4, 2021 08:23 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"