Skip to content

Instantly share code, notes, and snippets.

View andboson's full-sized avatar
🌴

Andrii Bosonchenko andboson

🌴
  • Cherkasy, UKR \ Alicante, SP
View GitHub Profile
@alexedwards
alexedwards / Makefile
Last active April 23, 2024 16:12
Boilerplate Makefile for Go projects
# Change these variables as necessary.
MAIN_PACKAGE_PATH := ./cmd/example
BINARY_NAME := example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
@NicoSB
NicoSB / basic-card.json
Last active June 13, 2020 23:10
Actions on Google Conversation API v2 - Sample Responses
{
"items": [
{
"simpleResponse": {
"textToSpeech":"This is the first simple response for a basic card"
}
},
{
"basicCard": {
"title":"Title: this is a title",
@davisford
davisford / Setup MongoDB on localhost as Replica Set
Last active March 6, 2024 21:40
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1
@walm
walm / main.go
Last active February 27, 2024 08:22
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@zchee
zchee / cgo.md
Last active April 18, 2024 06:14
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@mdwhatcott
mdwhatcott / custom_json.go
Created July 29, 2015 17:15
Example of implementing MarshalJSON and UnmarshalJSON to serialize and deserialize custom types to JSON in Go. Playground: http://play.golang.org/p/7nk5ZEbVLw
package main
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
)
func main() {
@aldur
aldur / nfs_automount.sh
Last active December 3, 2023 10:08
Mount an NFS share on Android
#!/bin/sh
# Mount an NFS share on Android
# Requirements:
# - Busybox
# - A kernel supporting nfs (either built-in or as a module)
# On my Nexus 7 2012 I use the following kernel:
# http://forum.xda-developers.com/showthread.php?t=2107224
# Remember: if you have problems of system space, simply delete some of the default stuff.
@bryfry
bryfry / gzip.go
Last active August 28, 2023 09:23
Idiomatic golang net/http gzip transparent compression (works with Alice)
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
// Gzip Compression
@slava-vishnyakov
slava-vishnyakov / README.md
Last active August 29, 2015 14:01 — forked from rezgaa/install_graphite_statsd_ubuntu_precise.sh
Graphite/Statsd installation

After install run

# start statsd
# start graphite

statsd is on 8125 port graphite is on http://127.0.0.1:8080/

@melekes
melekes / Makefile
Created March 21, 2014 09:34
Colored Makefile for Golang projects
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
DEPS = $(go list -f '{{range .TestImports}}{{.}} {{end}}' ./...)
deps:
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
@go get -d -v ./...
@echo $(DEPS) | xargs -n1 go get -d