Skip to content

Instantly share code, notes, and snippets.

View linux_memory.h
#include <chrono>
#include <thread>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include "opencensus/stats/stats.h"
#include "absl/strings/string_view.h"
View gist:ef0ae0db69e6918ba00a8d28977cff7c
package com.metrologicgroup.x4_events_ingestion.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.google.auto.value.AutoValue;
import java.io.Serializable;
View gist:657313df5aba4af29db09918636fe1c3
#!/usr/bin/env python
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
View gist:8729bfab439084a46d6a972661504028
#!/usr/bin/env python3
import sys
import json
events = []
device_state = {}
for line in sys.stdin:
events.append(json.loads(line))
View gist:b4e375c35662ca1c3e9bad2c7806f1d8
### Keybase proof
I hereby claim:
* I am nabam on github.
* I am nabam (https://keybase.io/nabam) on keybase.
* I have a public key ASCIiynDeyWEPdmKHeoU8ehWmjRei4L_Qjw-JmMQQmiKrwo
To claim this, I am signing this object:
View callback_server.py
import http.server
import socketserver
import threading
import queue
import json
CALLBACK_SERVER_PORT = 5000
CALLBACK_TIMEOUT = 10 # seconds
callback_queues = {}
View gist:de8d377f3d95d7597a03036aca8d48ce
<!DOCTYPE html>
<html lang=en>
<head>
<title>Swagger UI</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css">
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
</head>
<body>
<div class="swagger-ui" id="swagger-ui"></div>
<script>
View gist:3a75762c7301b8876f0c78d5593ebc69
#!/bin/env python3
import yaml
import sys
import argparse
import re
swagger = yaml.load(sys.stdin.read(), Loader=yaml.SafeLoader)
http_api_spec = {
'apiVersion': 'config.istio.io/v1alpha2',
View gist:a3ac0c73f1d1d3a322052c2ea0f9632f
package main
import (
"fmt"
"log"
"io/ioutil"
"net/http"
)
var state = make(map[string]int)