Skip to content

Instantly share code, notes, and snippets.

View ezodude's full-sized avatar
🦙
Llamas

Ezo Saleh ezodude

🦙
Llamas
View GitHub Profile
@ezodude
ezodude / multipart_upload.go
Created February 2, 2023 16:14 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@ezodude
ezodude / neo4j_cypher_cheatsheet.md
Created March 5, 2022 21:52 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@ezodude
ezodude / helper.go
Last active January 20, 2022 11:39
Pod logs in K8s Operator
func (r *AReconciler) publishMetrics(ctx context.Context, v *lt.LoadTest, logger logr.Logger) (*ctrl.Result, error) {
found := &v1.Job{}
err := r.Get(ctx, types.NamespacedName{
Name: v.Name,
Namespace: v.Namespace,
}, found)
if err != nil {
// The job may not have been created yet, so requeue
return &ctrl.Result{RequeueAfter: 5 * time.Second}, err
}
@ezodude
ezodude / kind-with-registry.sh
Created November 12, 2021 22:20 — forked from victorpaulo/kind-with-registry.sh
KinD cluster creation
#!/bin/sh
set -o errexit
# create registry container unless it already exists
reg_name='kind-registry'
reg_port='5000'
running="$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)"
if [ "${running}" != 'true' ]; then
docker run \
-d --restart=always -p "${reg_port}:5000" --name "${reg_name}" \
@ezodude
ezodude / trace.go
Created November 27, 2020 13:39
Trace Caller - great for debugging Golang code.
func trace(){
pc := make([]uintptr, 10) // at least 1 entry needed
runtime.Callers(2, pc)
f := runtime.FuncForPC(pc[0])
file, line := f.FileLine(pc[0])
fmt.Printf("%s:%d %s\n", file, line, f.Name())
}
@ezodude
ezodude / GolangResources2018.md
Last active April 9, 2023 22:25
Go Resources

Go resources

I've considered these resources when making development decisions.😎

Go is backwards compatible. So these resources are still all relevant.⚡️⚡️

The Basics

-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDpa4ZTVtwSACeU
5SG4HaZfeDeTkGiVfdV6sT4DmqqzlO5YtezvBWhNGLhAnolTgkMTvB0mgWAiKpUK
X4PFYQgGqveY21V96Sd+RRvaJKvxIGczLnyNaJQnSYVNQUHJclV3+p9MSAP/HRM1
b4zwJWYrFt2aw0vI4JX+wj3b17Rkhe25x8PZmu5cPuZKWOXiQ4QjvXSpCovVO3hD
9LpHvG8zko/R0vw4WjCx/iYNQAnMUS9KSxzdrbjfMTBc15zZgJXN6cWzw81U9Yjy
iJlAbfVYI8WVPBIorlM1W5VtD+P09BRCJRZy9ihibBqfTFhe5hitvFwywCQzO5rt
G9dw8TCjAgMBAAECggEBAMwLI2PstPnDStZ8qcoxmQMxqpuDC/lKA3h6QbSS2o+b
K/M+LP0QZAmpBz/tliv63bn9ohnL1IZpZNmpfx3mYUa64y+q5APp8Y0OyncZwXhK
FAyIoXZXqdLiEPXkiqaXHKGB4wiil2PGPcljVveCKdqW5WbpO3FA6b3GfJ6V4+pO
@ezodude
ezodude / .gitconfig
Created November 29, 2016 22:35 — forked from rab/.gitconfig
A good starting point for ~/.gitconfig
# -*- Conf -*-
[color]
branch = auto
diff = auto
status = auto
showbranch = auto
ui = true
# color.branch
# A boolean to enable/disable color in the output of git-branch(1). May be set to always, false (or
@ezodude
ezodude / qemu_run.sh
Created October 12, 2016 10:10 — forked from JasonGhent/qemu_run.sh
Attempt to update https://gist.github.com/JasonGhent/e7deab904b30cbc08a7d to work a year later
# script insstalls qemu and vagrant, then uses vagrant to build a qemu-
# supported rpi kernel for dev.
# - tested with 2015-02-16-raspbian-wheezy.zip on OSX El Capitan
# Variables
IMAGE=http://downloads.raspberrypi.org/raspbian_latest
IMG_PATH="/vagrant/raspbian_latest.img"
PI_LINUX=https://github.com/raspberrypi/linux
PI_LINUX_BRANCH="rpi-4.2.y"
PI_TOOLS=https://github.com/raspberrypi/tools
body{
height: 470px;
width: 320px;
}
.content, .footer{
border: 1px solid #ccc;
}
.content{