Skip to content

Instantly share code, notes, and snippets.

@Blogoslov
Blogoslov / Makefile
Last active September 8, 2015 15:24 — forked from border/Makefile
json example in golang
include $(GOROOT)/src/Make.inc
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4
all:
$(GC) jsontest.go
$(LD) -o jsontest.out jsontest.$O
format:
$(GOFMT) -w jsontest.go
package main
import (
"flag"
"log"
"os"
"syscall"
"unsafe"
"path/filepath"
"bufio"
@Blogoslov
Blogoslov / nested.data.redis
Created September 8, 2017 07:52 — forked from petrushev/nested.data.redis
example of storing nested data structures in redis
roomrate
========
{
'city': 'Berlin',
'hotel': 'Hilton',
'date': '2013-08-09'
'room_type': 'single',
'occupancy': 2,
'avail_count': 13,
'booked_count': 4,
@Blogoslov
Blogoslov / log.go
Created July 5, 2018 08:21 — forked from mbrevoort/log.go
Adding caller function, filename and line number to logrus log entries
package utils
import (
"runtime"
"github.com/Sirupsen/logrus"
)
// DecorateRuntimeContext appends line, file and function context to the logger
func DecorateRuntimeContext(logger *logrus.Entry) *logrus.Entry {
@Blogoslov
Blogoslov / postgres-json-cheatsheet.md
Created September 11, 2018 12:53 — forked from rmtsrc/postgres-json-cheatsheet.md
Using JSON in Postgres by example

PostgreSQL JSON Cheatsheet

Using JSON in Postgres by example.

Quick setup via Docker

  1. Download and install: Docker Toolbox
  2. Open Docker Quickstart Terminal
  3. Start a new postgres container:
    docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres