Skip to content

Instantly share code, notes, and snippets.

View c1982's full-sized avatar
🍄
yeah!

Oğuzhan Yılmaz c1982

🍄
yeah!
View GitHub Profile
@c1982
c1982 / player_test.go
Created December 29, 2021 13:35
DoD vs Std Struct
package main
import (
"math/rand"
"testing"
)
type Player struct {
ID int
health int
@c1982
c1982 / packer-edit.go
Created July 30, 2021 21:13
Packet-Editing
package main
import (
"bytes"
"encoding/hex"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
@c1982
c1982 / aws-region-names.go
Last active May 11, 2021 10:41
AWS region names with bill region names
type AwsRegion struct {
Region string
Location string
Code string
A1 string
Latitude string
Longitude string
}
@c1982
c1982 / inline_struct.go
Last active December 27, 2020 14:53
Benchmarks for inline, outline, anonymous struct
package main
import (
"encoding/json"
"testing"
)
type PD2 struct {
Property1 int `json:"property1"`
Property2 int `json:"property2"`
package main
import "testing"
var testmk11 = []string{"scorpion", "sub-zero", "raiden", "kano", "kitana"}
func ifloop() {
for i := 0; i < len(testmk11); i++ {
@c1982
c1982 / no-global-var.go
Created October 28, 2019 08:03
no-global-var
package main
var levels = []string{"LVL1","LVL2","LVL3"}
func main(){
fmt.Println(levels)
}
image: docker
services:
- docker:dind
stages:
- gosec
- build
variables:
[[runners]]
name = "docker-runner"
url = "https://enter-yor-gitlab-hostname.com/"
token = "Nd3KKoj2N-x"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker"
privileged = true
disable_entrypoint_overwrite = false
@c1982
c1982 / main.go
Created March 29, 2019 23:21
Example for my blog post
package main
import (
"crypto/md5"
"fmt"
"net/http"
)
var Version string
@c1982
c1982 / Dockerfile
Last active March 29, 2019 23:18
Example for my blog post
FROM golang:1.11.6 as builder
ARG VERSION
ENV CGO_ENABLED=0
WORKDIR $GOPATH/src/md5go
COPY . .
RUN go install -a --installsuffix cgo -ldflags "-X main.Version=${VERSION}" ./...