Skip to content

Instantly share code, notes, and snippets.

View kwk's full-sized avatar

Konrad Kleine kwk

View GitHub Profile
@kwk
kwk / timeular-activity-time.sh
Last active April 16, 2021 19:59
Display amount of time spent in activity tracked by timeular for the current day
#!/bin/bash
set -e
# Go here to create or refresh an API key and API secret and paste them:
# https://profile.timeular.com/#/app/account
# Put this in your ~/.timeular.config
# API_KEY="..."
# API_SECRET="..."
@lattner
lattner / LLVMDecisionMaking.md
Last active May 24, 2020 22:31
[PITCH] Improvements to LLVM Decision Making

MOVED

This doc has been moved to A Google doc to allow easier commenting and collaboration.

@pqnelson
pqnelson / filter-uses.py
Created February 25, 2019 15:18
Noweb syntax highlighting
#!/usr/bin/env python
import fileinput
from re import sub
deletemode = False
codemode = False
asmmode = False
breakmode = False

Install Strimzi on Minishift

  • start minishift with a profile named kafka

on macOS

minishift --profile kafka start --vm-driver=xhyve --memory=7000 --cpus=4 --disk-size=50g

on linux

@aslakknutsen
aslakknutsen / design.go
Last active September 28, 2017 08:52
JSON API ResourceObject GOA
// Definition
/*
func test() {
account := app.AccountSingle{}
account.Data.ID
account.Data.Type
account.Data.Attributes.Name
account.Data.Relationships.OwnedBy
account.Data.Relationships.OwnedBy.Meta
account.Data.Relationships.OwnedBy.Related
db := requires.Resource(t, Database)
space, wis := requires.Objects(t, Space(1), WorkItems(3, ExtraLongTitle()))
func ExtraLongTitle()  {
return func(wi *WorkItem) {
wi.Data.Attributes["system.title"] = ".. long thing.."
}
}
@pop
pop / README.md
Created November 18, 2016 22:03
Buildbot on K8s
@aslakknutsen
aslakknutsen / design.go
Created October 27, 2016 14:18
json api ish Goa struct
// ALMRelationship describes the basic relationship
var ALMRelationship = Type("ALMRelationship", func() {
Attribute("data", ArrayOf(Any))
})
// ALMLink describes a single linked resource
var ALMLink = Type("ALMLink", func() {
Attribute("href", Integer, "Unique numeric representation of the error")
Attribute("meta", HashOf(String, Any), "Related meta information")
})
@ipbastola
ipbastola / jq to filter by value.md
Last active March 28, 2024 10:04
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@kwk
kwk / Makefile
Last active March 17, 2024 22:54
Compiling with Address Sanitizer (ASAN) with CLANG and with GCC-4.8
.PHONY: using-gcc using-gcc-static using-clang
using-gcc:
g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc
using-gcc-static:
g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static