Instantly share code, notes, and snippets.

View gist:79a577755a4b78171fcea4d03b9dca6f
module.exports = function Next(views, sViews, body) {
const directions = ['forward', 'right', 'left'];
const treatMatch = views.find(v => { return v == "treat"});
if (treatMatch) {
return treatMatch.direction;
}
let possibleActions = directions;
View testing-snake.ts
module.exports = function Next(views, sViews, body) {
const directions = ['up', 'down', 'right', 'left'];
const treatMatch = views.find(v => { return v == "treat"});
if (treatMatch) {
return treatMatch.direction;
}
let possibleActions = directions;
View gist:a6d15ba33b219daf2b99f6bb8759be61
module.exports = function Next(views, sViews, body) {
const directions = ['up', 'down', 'right', 'left'];
const treatMatch = views.find(v => { return v == "treat"});
if (treatMatch) {
return treatMatch.direction;
}
let possibleActions = directions;
View secret.json
{
"config": {
"autoconnect": true,
"bot": "awesomo_bot",
"name": "#ccscanf",
"oauth": "oauth:xyz”,
"prefix": "\\",
"silent": false,
"standupReminder": true,
"windowState": {
View run_git_gc.py
#!/usr/bin/env python3
# Copyright 2018 Alexander Alemayhu https://alemayhu.com
import argparse
import os
import subprocess
def handle(directory):
for folder, subs, files in os.walk(directory):
View debuginfo.md

Cilium debug information

Cilium version

0.13.90 (648ab3b) linux/amd64

Kernel version

View blacklist_kern.bpf
// vim: set filetype=c:
#include <bpf/api.h>
#include <linux/ip.h>
#include <lib/eth.h>
#include <lib/utils.h>
struct bpf_elf_map __section_maps blacklist_map = {
.type = BPF_MAP_TYPE_HASH,
.size_key = sizeof(uint32_t),
.size_value = sizeof(uint32_t),
View cilium
#!/bin/bash
# /usr/local/bin/cilium
docker exec -ti cilium cilium $@
View gist:fef9ba1036e947fd7ddda1b4d8176043
docker run -v ${PWD}:/tmp scanf/ebpf-disasm -s from-container /tmp/bpf_lxc.o|wc -l
View 0001-Add-debug.patch
From 753d012c49e5dc6b50900f58be54f437937ce8ef Mon Sep 17 00:00:00 2001
From: Alexander Alemayhu <alexander@alemayhu.com>
Date: Wed, 4 Oct 2017 12:30:08 +0200
Subject: [PATCH] Add debug
Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com>
---
bpf/init.sh | 4 ++++
bpf/join_ep.sh | 5 +++++
daemon/bpf.sha | 4 ++--