Skip to content

Instantly share code, notes, and snippets.

function role(roleplayer, role)
local mt = getmetatable(roleplayer)
setmetatable(role, mt)
setmetatable(roleplayer, role)
end
function striprole(roleplayer)
setmetatable(roleplayer, getmetatable(getmetatable(roleplayer)))
end
@egonelbre
egonelbre / telnet.sc
Last active May 28, 2020 21:06
Telnet parsing in Scala
object Telnet {
type ByteString = Vector[Byte]
type Commands = Vector[Command]
abstract class Command
case class Line(text: String) extends Command
case class SubNegotiaton(option: Byte, data: ByteString) extends Command
case class Will(option: Byte) extends Command
// 🚀 Fiber is an Express inspired web framework written in Go with 💖
// 📌 API Documentation: https://fiber.wiki
// 📝 Github Repository: https://github.com/gofiber/fiber
// 🙏 Credits to github.com/labstack/echo/blob/master/middleware/csrf.go
package csrf
import (
"crypto/subtle"
"errors"
@egonelbre
egonelbre / go.mod
Last active December 27, 2019 10:41
generate-aliases generates aliases for specified package
module generate-aliases
go 1.13
@egonelbre
egonelbre / count.svg
Created September 19, 2019 14:58
Density plot example.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@egonelbre
egonelbre / testcase.go
Created March 12, 2019 09:55
grpc bidi streaming testcase
package main
import (
"context"
"errors"
"fmt"
"net"
"time"
"google.golang.org/grpc"
@egonelbre
egonelbre / default.txt
Last active December 15, 2018 12:05
Go all.bat on all different filesystems
Building Go cmd/dist using C:\Go
Building Go toolchain1 using C:\Go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for windows/amd64.
##### Testing packages.
ok archive/tar 3.046s
package main
import (
"database/sql"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"time"
@egonelbre
egonelbre / main.go
Last active October 14, 2018 02:17
Vecty bugs
package main
import (
"encoding/hex"
"fmt"
"math/rand"
"github.com/gopherjs/vecty"
"github.com/gopherjs/vecty/elem"
"github.com/gopherjs/vecty/event"
@egonelbre
egonelbre / absolutecover.go
Created October 5, 2018 15:55
Converts Go profile from package paths to filepaths
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path"