Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
trust me, i'm a ca.crt.

Mike Danese mikedanese

🤔
trust me, i'm a ca.crt.
View GitHub Profile
View gist:5045545
typedef void (*function)();
char program[32];
int main() {
char *t = program;
unsigned i, n;
for (;;) {
for (i = 3; i; i--) {
n = getch() - '0';
if (n > 7) (*(function)program)();
*t = *t * 8 + n;
@mikedanese
mikedanese / AnnotationProcessorTest.java
Last active Mar 11, 2020
AnnotationProcessorTest with JUnit
View AnnotationProcessorTest.java
import org.junit.Before;
import org.junit.BeforeClass;
import javax.annotation.processing.Processor;
import javax.tools.Diagnostic;
import javax.tools.DiagnosticCollector;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
View main.go
package main
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
View types.go
type Probe struct {
HTTPGet *HTTPGetAction `json:"httpGet,omitempty"`
TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"`
Exec *ExecAction `json:"exec,omitempty"`
}
type LivenessProbe struct {
Probe `json:",inline"`
InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty"`
}
View get_timeout.go
package main
import (
"errors"
"net/http"
"net/http/httptest"
"testing"
"time"
)
View gist:b48b59bc5a2f679ccc1b
package main
import (
"flag"
"net"
"os"
"syscall"
"github.com/golang/glog"
)
View BUILD
cc_test(
name = "my_test",
srcs = ["my_test.cc"],
deps = ["//external:gtest/main"],
)
View gist:6c47c336e749e5c08944
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.3.0 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
View ns.json
{
"kind": "Namespace",
"apiVersion": "v1",
"metadata": {
"name": "foo"
}
}
{
"kind": "Namespace",
"apiVersion": "v1",
View graceful.sh
#! /bin/bash
set -o pipefail
set -o nounset
service::log() {
msg="$1"
timestamp=$(date +"[%m%d %H:%M:%S]")
printf "+++ %s: %s\n" "${timestamp}" "${msg}" > /dev/stderr
}