Skip to content

Instantly share code, notes, and snippets.

View andygrunwald's full-sized avatar

Andy Grunwald andygrunwald

View GitHub Profile
@andygrunwald
andygrunwald / http-method-are-strings.md
Created June 1, 2023 11:57
HTTP Methods are just strings ...

Small showcase that HTTP Methods are just strings. This enables you to define your own one.

First, create a small demo webserver. This example is in Go (store the code into a file named main.go):

package main

import (
	"fmt"
@andygrunwald
andygrunwald / FOSDEM_2021_SCHEDULE.md
Last active February 6, 2021 08:41
FOSDEM 2021 Schedule
@andygrunwald
andygrunwald / main.dart
Created July 17, 2020 07:36
Dart Null to String casting fails without error / silently
void main() {
print("hey");
Map<String, dynamic> response = {
'description': Null,
};
var tS = BarToString.fromApiResponse(response);
print("toString() is working");
print(tS.description);
@andygrunwald
andygrunwald / main.dart
Created July 17, 2020 07:35
Dart Null to String casting fails with error
void main() {
dynamic foo = Null;
String barToString = foo.toString();
print("bar To String");
print(barToString);
String barAs = foo as String;
print("bar As");
print(barAs);
@andygrunwald
andygrunwald / gist:91f9bd8ddf89e4bd552f3bdc312c453b
Created July 18, 2016 06:47
Logs of failing Mesos 1.0.0-RC1 of mesos-compose (c2040b56edde69d67ef95f7c93e40bdb153c115b)
➜ mesos-compose git:(master) ✗ docker logs 8ecfac88a254
I0718 06:38:54.030550 4653 main.cpp:264] Build: 2016-06-22 05:18:07 by root
I0718 06:38:54.034214 4653 main.cpp:266] Version: 1.0.0
I0718 06:38:54.037546 4653 main.cpp:269] Git tag: 1.0.0-rc1
I0718 06:38:54.037557 4653 main.cpp:273] Git SHA: dfe62665df67162e4c1064f524d6c0180100a9d2
I0718 06:38:54.158023 4653 containerizer.cpp:198] Using isolation: posix/cpu,posix/mem,filesystem/posix,network/cni
I0718 06:38:54.175022 4653 linux_launcher.cpp:101] Using /sys/fs/cgroup/freezer as the freezer hierarchy for the Linux launcher
2016-07-18 06:38:54,176:4653(0x7f4bb2357700):ZOO_INFO@log_env@726: Client environment:zookeeper.version=zookeeper C client 3.4.8
2016-07-18 06:38:54,181:4653(0x7f4bb2357700):ZOO_INFO@log_env@730: Client environment:host.name=default
2016-07-18 06:38:54,181:4653(0x7f4bb2357700):ZOO_INFO@log_env@737: Client environment:os.name=Linux
@andygrunwald
andygrunwald / meminfo
Created January 22, 2016 21:52
/proc/meminfo of a AWS c4.xlarge instance in eu-central-1b Raw
ubuntu@ip-172-31-16-197:~/php-redis-server$ cat /proc/meminfo
MemTotal: 7659540 kB
MemFree: 7163836 kB
Buffers: 21796 kB
Cached: 344564 kB
SwapCached: 0 kB
Active: 236116 kB
Inactive: 146080 kB
Active(anon): 15904 kB
Inactive(anon): 284 kB
@andygrunwald
andygrunwald / cpuinfo
Created January 22, 2016 21:51
/proc/cpuinfo of a AWS c4.xlarge instance in eu-central-1b
ubuntu@ip-172-31-16-197:~/php-redis-server$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 63
model name : Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz
stepping : 2
microcode : 0x25
cpu MHz : 2900.044
cache size : 25600 KB
@andygrunwald
andygrunwald / redis_kafka_returner.py
Created March 19, 2015 14:51
A custom Saltstack returner to write into redis and kafka at once
# -*- coding: utf-8 -*-
'''
Return data to a redis server
To enable this returner the minion will need the python client for redis
installed and the following values configured in the minion or master
config, these are the defaults:
redis.db: '0'
redis.host: 'salt'
@andygrunwald
andygrunwald / redis.py
Created February 24, 2015 10:16
Custom saltstack grain to identify the redis version
# -*- coding: utf-8 -*-
import salt.utils
# Solve the Chicken and egg problem where grains need to run before any
# of the modules are loaded and are generally available for any usage.
import salt.modules.cmdmod
def redis_version():
'''
RoomIndex =
'Foo': 'Bar Baz Foo Dhi',
'Test': 'This is a description'
if filter
for room, location of RoomIndex when location.toLowerCase().indexOf(filter) != -1 || room.toLowerCase().indexOf(filter) != -1
message.send "#{room}: #{location}"
else
for room, location of RoomIndex
message.send "#{room}: #{location}"