Skip to content

Instantly share code, notes, and snippets.

View soasme's full-sized avatar
🐷
Peppa PEG v1.16.0 is released!

Ju soasme

🐷
Peppa PEG v1.16.0 is released!
View GitHub Profile
{ pkgs ? import <nixpkgs> {}}:
with pkgs; mkShell {
# Include C++ headers for regular clang calls:
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
"-I${lib.getDev libcxx}/include/c++/v1"
];
nativeBuildInputs = [
...
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
---- MODULE VirtualMachine ----
VM_Version == "1.0.0"
LOCAL INSTANCE Sequences
LOCAL INSTANCE Integers
LOCAL INSTANCE TLC
CONSTANT PC
CONSTANT SUBJ

Overview

In this document, I propose to separate SLI from SLO as a new data kind in OpenSLO specification. See discussion #29.

SLI

A service level indicator (SLI) represents how to gather data from metric sources.

apiVersion: openslo/v0.2.0-beta
# python3 /tmp/iterategosrc.py /tmp/go/src/
# check whether go grammar can pass all golang source files.
import os
import sys
import glob
import subprocess
root_dir = sys.argv[1]
total = 0
failed = 0
for filename in glob.iglob(root_dir + '**/**.go', recursive=True):
@soasme
soasme / go.peg
Last active August 23, 2021 02:44
newline = "\x0a";
@spaced @lifted @squashed
whitespace = " " / "\t" / "\r" / "\n";
@spaced @lifted @squashed
comment = "//" (!"\n" .)* "\n"?
/ "/*" (!"*/" .)* "*/";
unicode_char = !"\x0a" .;
# An idea of a new scripting language that focuses on glueing system commands.
# single line command
$ echo hello world
# multi-lines command
$(
python myscript.py
&& echo "done"
)
@soasme
soasme / attrs.c
Last active April 21, 2021 04:01
Attrs example.
// https://gist.github.com/soasme/7ede641156d2a7bee4b8bec2e87c2197
#include <stdio.h>
#include "attrs.h"
AttrsError CoordinatePrint(AttrsArgs args) {
AttrsRef self = AttrsGetSelf(args);
FILE* f = AttrsGetPtrArg(args, "f", FILE*); // Or, FILE* f = (FILE*) AttrsGetPtr (AttrsGetArg(args, "f"));
int x = AttrsGetInt(self, "x"); // Or, int x = AttrsGetInt(args, "self.x");
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.10362' (creator: callgrind-3.16.0)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
LL cache:
Timerange: Basic block 0 - 7341727
Trigger: Program termination
Profiled target: ./a.out (PID 10362, part 1)
Events recorded: Ir
--------------------------------------------------------------------------------
Profile data file 'callgrind.out.63642' (creator: callgrind-3.16.0)
--------------------------------------------------------------------------------
I1 cache:
D1 cache:
LL cache:
Timerange: Basic block 0 - 190863280
Trigger: Program termination
Profiled target: ./a.out (PID 63642, part 1)
Events recorded: Ir