Skip to content

Instantly share code, notes, and snippets.

package main
import (
"bufio"
"bytes"
"io"
"strings"
"golang.org/x/term"
)
@cagedmantis
cagedmantis / append_to_value.py
Created August 4, 2018 14:45
append to a list in python
d = {"foo":[]}
for num in range(10):
for key, value in d.iteritems():
value.append(num)
d["foo"].append(23)
@cagedmantis
cagedmantis / http.go
Created December 27, 2017 18:05
Simple storage server
package main
import (
"fmt"
"log"
"net/http"
)
// web provides an interface for the setting and getting of
// keys via http endpoints.

Keybase proof

I hereby claim:

  • I am cagedmantis on github.
  • I am exobit (https://keybase.io/exobit) on keybase.
  • I have a public key ASCvnbYMHagFsMnkfQzBszdtii5LJDnjzBh6ZE-nCmsY9Ao

To claim this, I am signing this object:

resource "null_resource" "init_serf" {
count = "${var.num_nodes}"
depends_on = [ "digitalocean_droplet.serf" ]
provisioner "remote-exec" {
connection {
user = "root"
}
#include <iostream>
#include <vector>
#include <queue>
template<class T>
void merge(std::vector<T> &vec, int low, int mid, int high)
{
int index = low;
std::queue<T> left;
std::queue<T> right;

Keybase proof

I hereby claim:

  • I am cagedmantis on github.
  • I am exobit (https://keybase.io/exobit) on keybase.
  • I have a public key whose fingerprint is ACD7 B92F 31D5 FC5F B518 7753 FBA6 692D D38D 8F23

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am cagedmantis on github.
  • I am exobit (https://keybase.io/exobit) on keybase.
  • I have a public key whose fingerprint is 2F97 7A2E 0D3F 0DB1 4D9F E016 DCB3 BA31 9774 34B6

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am cagedmantis on github.
* I am exobit (https://keybase.io/exobit) on keybase.
* I have a public key whose fingerprint is 2F97 7A2E 0D3F 0DB1 4D9F E016 DCB3 BA31 9774 34B6
To claim this, I am signing this object:
struct foo
{
int moo;
char c[];
};
struct bar
{
int moo;