This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GOPATH=$(shell pwd)/vendor:$(shell pwd) | |
GOBIN=$(shell pwd)/bin | |
GOFILES=$(wildcard *.go) | |
GONAME=$(shell basename "$(PWD)") | |
PID=/tmp/go-$(GONAME).pid | |
build: | |
@echo "Building $(GOFILES) to ./bin" | |
@GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o bin/$(GONAME) $(GOFILES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mcalc | |
import ( | |
"context" | |
"github.com/propellerads/offer-api/app/log/field" | |
"go.uber.org/zap" | |
) | |
type EventSender struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gateway | |
import ( | |
"context" | |
"net/http" | |
"github.com/grpc-ecosystem/grpc-gateway/runtime" | |
"google.golang.org/grpc" | |
"golang.org/x/sync/errgroup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"crypto/md5" | |
"encoding/hex" | |
) | |
func GetMD5Hash(text string) string { | |
hasher := md5.New() | |
hasher.Write([]byte(text)) | |
return hex.EncodeToString(hasher.Sum(nil)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below). | |
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G; | |
# Gzip was on in another conf file of mine...You may need to uncomment the next line. | |
#gzip on; | |
gzip_disable msie6; | |
gzip_static on; | |
gzip_comp_level 4; | |
gzip_proxied any; | |
# Again, be careful that you aren't overwriting some other setting from another config's http {} section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global url."git@gitlab.com:".insteadOf "https://gitlab.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type Example struct { | |
id int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func call() { | |
mm := m() | |
fmt.Println(mm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let addButton:UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(FeedsController.add)) | |
self.navigationItem.setRightBarButtonItems([addButton], animated: true) |