Skip to content

Instantly share code, notes, and snippets.

View MilosSimic's full-sized avatar

Milos MilosSimic

  • Faculty of technical sciences Novi Sad
  • Novi Sad
View GitHub Profile
@MilosSimic
MilosSimic / serf.go
Created November 23, 2022 16:25 — forked from fsamin/serf.go
Use hashicorp/serf with golang
package main
import (
"log"
"os"
"os/signal"
"strconv"
"syscall"
"github.com/hashicorp/serf/serf"
cd /Library/Preferences
sudo rm com.sophos.sav.plist

cd /Library/Application\ Support/Sophos/cloud/Installer.app/Contents/MacOS/tools/
sudo ./InstallationDeployer —force_remove
@MilosSimic
MilosSimic / my_list_layout.xml
Created March 31, 2022 08:20 — forked from f2face/my_list_layout.xml
Disable multi-touch in RecyclerView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
...>
<androidx.recyclerview.widget.RecyclerView
...
android:splitMotionEvents="false" />
</LinearLayout>
@MilosSimic
MilosSimic / go_decode.go
Created November 6, 2021 15:11 — forked from miguelmota/go_decode.go
Golang gob encoding and decoding example
package main
import (
"bytes"
"encoding/gob"
"fmt"
"log"
)
func main() {
package main
import (
"context"
"fmt"
"log"
"net/http"
"strings"
"github.com/dgrijalva/jwt-go"
)
func middleware(next http.Handler) http.Handler {
package main
import (
"strings"
"path/filepath"
)
func fileNameWithoutExtension(fileName string) string {
return strings.TrimSuffix(fileName, filepath.Ext(fileName))
}
@MilosSimic
MilosSimic / golang-uint64-uint32-to-bytes.md
Created June 17, 2021 12:29 — forked from chiro-hiro/golang-uint64-uint32-to-bytes.md
Golang uint64, uint32 to bytes array

Wrote for a joyful journey of Go.

package main

import (
	"fmt"
)

func i64tob(val uint64) []byte {
package main
import (
"log"
"net/http"
"time"
"github.com/alexellis/faas/gateway/metrics"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus"
@MilosSimic
MilosSimic / main.go
Created May 7, 2021 14:22 — forked from tembleking/main.go
Prometheus Golang Example
package main
import (
"fmt"
"log"
"math/rand"
"net/http"
"time"
"github.com/prometheus/client_golang/prometheus"
@MilosSimic
MilosSimic / main.go
Created April 17, 2021 22:34 — forked from kpurdon/main.go
golang graceful server shutdown example
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"