Skip to content

Instantly share code, notes, and snippets.

View xor-gate's full-sized avatar
👽

Jerry Jacobs xor-gate

👽
View GitHub Profile
@sayden
sayden / ObserverDesignPattern.go
Created December 14, 2015 22:45
Observer Pattern in Golang
package main
import "fmt"
//Listener is a
type Listener struct {
ID int
}
//ListenerInterface is an
@ygit
ygit / SkipVerification.txt
Last active September 9, 2025 21:19
Skip Verification of Mac Apps
xattr -d com.apple.quarantine /path/to/app/myMacApp.app
@josephspurrier
josephspurrier / sshclient.go
Last active September 10, 2022 02:23
Golang SSH Client
package main
import (
"bufio"
"io/ioutil"
"os/signal"
//"syscall"
"fmt"
"log"
"os"
func createTorClient() *http.Client {
proxyURL, err := url.Parse("socks5://127.0.0.1:9150")
if err != nil {
log.Fatal(err)
}
dialer, err := proxy.FromURL(proxyURL, proxy.Direct)
if err != nil {
log.Fatal(err)
}
@AntoineAugusti
AntoineAugusti / limitConcurrentGoroutines.go
Last active July 30, 2024 17:58
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {
@wavded
wavded / go-ci-build.sh
Last active March 1, 2023 23:30
Go Jenkins CI Script - golang
#!/bin/bash
# Go build script that runs cloc, cpd, lint, vet, test and coverage for Jenkins
#
# Outside tools include:
# gocov: go get github.com/axw/gocov
# gocov-xml: go get github.com/t-yuki/gocov-xml
# go2xunit: go get bitbucket.org/tebeka/go2xunit
# jscpd: npm i jscpd -g
# cloc: npm i cloc -g
@nl5887
nl5887 / main.go
Last active April 27, 2016 18:15
Generate OpenPGP signature using Golang
package main
import (
"bytes"
"crypto/rsa"
"fmt"
"log"
"strings"
"golang.org/x/crypto/openpgp"
@agupta666
agupta666 / tee_page.go
Last active April 30, 2018 10:04
io.TeeReader usage
package main
import (
"net/http"
"log"
"io"
"bufio"
"os"
)
@jamesrr39
jamesrr39 / Golang program stdin stdout interaction.md
Last active July 12, 2023 18:21
Using stdout and stdin from other programs in Golang

Go program interaction

Example of how to use stdout and stdin from other programs in golang

Requires go

Run

go run parentprocess.go
@jackspirou
jackspirou / rewriteImportPaths.go
Last active December 21, 2022 17:48
A method for rewriting golang import paths.
package importpaths
import (
"log"
"os"
"strconv"
"strings"
"go/ast"
"go/parser"