Skip to content

Instantly share code, notes, and snippets.

@asim
asim / helloworld.go
Last active February 8, 2020 22:14
A go-micro service
package main
import (
"context"
"log"
pb "github.com/micro/examples/helloworld/proto"
"github.com/micro/go-micro/v2"
)

A Gopher Rising

Inspired by Maya Angelou's Still I Rise

You may walk through my GitHub history,
With it’s non idiomatic and fragal lines,
You may value me less than dirt,
But still, like dust, I’ll rise.
import axios from 'axios';
import {toCamelCase, toSnakeCase} from '../util';
import qs from 'qs';
// You can intercept requests or responses before they are handled by then or catch.
// https://github.com/axios/axios#interceptors
// Add a response interceptor and camelCase return data (for JS)
axios.interceptors.response.use((response) => {
response.data = toCamelCase(response.data);
@acolyer
acolyer / service-checklist.md
Last active January 30, 2024 17:39
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!