Skip to content

Instantly share code, notes, and snippets.

Matthias Loibl metalmatze

Block or report user

Report or block metalmatze

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@metalmatze
metalmatze / .gitignore
Last active Mar 6, 2019
kube-prometheus-demo
View .gitignore
.demo-last-step
@metalmatze
metalmatze / prometheus.diff
Last active Jan 16, 2019
Changing Prometheus in Custom Resource with Prometheus Operator
View prometheus.diff
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
labels:
prometheus: k8s
name: k8s
namespace: monitoring
spec:
alerting:
alertmanagers:
@metalmatze
metalmatze / http.go
Created Jun 29, 2018
Run Go as WebAssembly
View http.go
package main
import (
"fmt"
"net/http"
)
// https://github.com/golang/go/tree/master/misc/wasm
func main() {
@metalmatze
metalmatze / substract.go
Created Apr 6, 2017
What not to do in Go.
View substract.go
// Subtract deals with subtraction of all types of number.
func Subtract(left interface{}, right interface{}) interface{} {
var rleft, rright int64
var fleft, fright float64
var isInt = true
switch left.(type) {
case int:
rleft = int64(left.(int))
case int8:
rleft = int64(left.(int8))
View php.php
<?php
$a = array(1 => 'a', true => 'b', 'c', "2" => 'd', 2 => "e", 0x1 => "g", 2e0 => "h");
echo(count($a));
var_dump($a);
View keybase.md

Keybase proof

I hereby claim:

  • I am metalmatze on github.
  • I am metalmatze (https://keybase.io/metalmatze) on keybase.
  • I have a public key ASBx54BquU34HLeRqBqIjiu-kA18K4Fazm3Nf2ERCfVHkgo

To claim this, I am signing this object:

View telegram.go
package main
import (
"github.com/tucnak/telebot"
"log"
"time"
)
var (
bot *telebot.Bot
@metalmatze
metalmatze / rx-retrofit.java
Created Oct 22, 2015
Retrofit returning a observable which is mapped and then copied into the realm Database
View rx-retrofit.java
Api.with(getActivity()).request()
.authors()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.map(authorJsonArray -> authorJsonArray.data)
.subscribe(authors -> {
realm.beginTransaction();
realm.copyToRealmOrUpdate(authors);
realm.commitTransaction();
});
View maps.jsx
render() {
return (
<GoogleMaps
containerProps={{
style: {
height: "100%"
}
}}
ref="map"
View element-name.html
<dom-module id="element-name">
<style>
/* CSS rules for your element */
</style>
<template>
<!-- local DOM for your element -->
<div>{{greeting}}</div> <!-- data bindings in local DOM -->
</template>
</dom-module>
You can’t perform that action at this time.