Skip to content

Instantly share code, notes, and snippets.

View IObert's full-sized avatar
🦁

Marius Obert IObert

🦁
View GitHub Profile
@IObert
IObert / function.js
Created April 26, 2023 10:39
Trigger Studio Flow via Segment Destination Function
async function onIdentify(event, settings) {
let response;
try {
const profileApiResponse = await fetch(
`https://profiles.segment.com/v1/spaces/${
event.context.personas.space_id
}/collections/users/profiles/user_id:${encodeURIComponent(
event.userId
)}/traits`,
{
@IObert
IObert / function.js
Created April 26, 2023 10:36
Send Message via Segment Destination Function
async function onIdentify(event, settings) {
let response;
try {
const profileApiResponse = await fetch(
`https://profiles.segment.com/v1/spaces/${
event.context.personas.space_id
}/collections/users/profiles/user_id:${encodeURIComponent(
event.userId
)}/traits`,
@IObert
IObert / deployment.yaml
Created October 18, 2022 13:12
Kyme 2.0 Deployment Manifest
TODO: Adapt namespace and host of API rule
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: content-type-converter
namespace: content-type-converter
labels:
app: content-type-converter
@IObert
IObert / mta.yaml
Created January 23, 2020 12:12
Sample project descriptor which generates tiny mtar archives
_schema-version: 2.0.0
ID: bookshop
version: 1.0.0
parameters:
enable-parallel-deployments: true
modules:
- name: bookshop-db
type: hdb
path: db
@IObert
IObert / pre-commit
Created December 9, 2019 16:57
Git pre-commit hook to sync version number in MTA.yaml and package.json
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
new_version=`cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]'`
@IObert
IObert / .zhsrc
Last active March 3, 2021 11:02
Simple aliases to make the life of CF developers easier
function checkCfStatus () {
if echo $(cf a 2>&1 >/dev/null) | grep -q 'The token expired\|Not logged in' $OUTPUT; then
cf login
fi
}
function preexecHook () {
if echo $1 | grep -q "cf "; then
checkCfStatus
fi