Skip to content

Instantly share code, notes, and snippets.

View htammen's full-sized avatar

Helmut Tammen htammen

View GitHub Profile
@htammen
htammen / tsconfig.json
Created July 17, 2019 13:34
tsconfig.json (Typescript configuration file for UI5 typescript projects)
{
"compilerOptions": {
"module": "none",
"target": "es5",
"sourceMap": true,
"noEmit": false,
"downlevelIteration": true,
"checkJs": false,
"allowJs": false,
"lib": ["dom", "es5", "es2015.promise", "es2015.iterable"],
@htammen
htammen / AppAdminApp.d.ts
Created July 17, 2019 13:47
Typescript type definitions for sample UI5 Typescript project
declare namespace de {
namespace tammenit {
namespace ui5 {
namespace AppAdminApp {
export class Component extends sap.ui.core.UIComponent {
/**
* returns the main Model of the application
*
* @returns {sap.ui.model.json.JSONModel} the main model of the application
@htammen
htammen / package.json
Created July 17, 2019 14:13
Package.json for UI5 Typescript projects
{
"name": "AppAdminApp",
"version": "0.0.1",
"engines": {
"node": ">=10.0.0"
},
"scripts": {
"start": "ui5 serve -o index.html",
"serve": "ui5 serve",
...
@htammen
htammen / gist:b276475267d6af00e23de6b1cce218d5
Created September 11, 2019 07:07
UI5 Input control email validation
<Input id="email1"
value="{path: '/email1', type: 'sap.ui.model.type.String', constraints: {search: '^((?!\\.)[\\w-_.]*[^.])(@\\w+)(\\.\\w+(\\.\\w+)?[^.\\W])$'}}"
type="Email"
></Input>
@htammen
htammen / xsa login via bitwarden.md
Last active July 20, 2020 14:53
securely login via shell

Want to securely login to command line tools without exposing your credentials?

  • Install one of the Bitwarden clients (https://github.com/bitwarden)
  • Create your secure passwords with the Bitwarden client
    • Here I created a secure item with the namen xsa-engine
  • Install the Bitwarden CLI (https://github.com/bitwarden/cli)
  • At command line login to the Bitwarden CLI (bw login)
  • Write a script like the following to securely connect to your applications / servers. Here I connect to the HANA XSA server via xs client.
  • chmod 755 xsa_login.sh
Hi @petermuessig ,
wow, what a comprehensive answer! Thank you very much!!! These were exactly the pointers I was lacking.
Especially the mentioned Babel plugin is brilliant: It does the heavy lifting for using a modern syntax and still achieves backwards compatibility. And it plays well with your middleware (no surprise there :-)).
So I've tried to get this running and succeeded. My steps were:
adapt your livetranspile middleware to also search for ts files, not just js files. I'm planning on submitting a PR for your middleware soon. Also I haven't adapted the build task, but this shouldn't be too hard either.
wiring the new middleware in ui5.yaml
Install the essential babel plugins
@htammen
htammen / prjcrawler.ts
Last active February 16, 2021 22:32
A script to get a list of (open) project offers
// This script reads open projects and outputs them to the console.
// This is quite messy cause I created it at a sunday evening.
// Will hopefully find time in the future to make it a bit more production ready
import {
decode as base64Decode,
encode as base64Encode,
} from 'https://deno.land/[email protected]/encoding/base64.ts';
import { ld } from 'https://x.nest.land/[email protected]/mod.ts'
import { parse } from "https://deno.land/std/flags/mod.ts"

How to debug XSA application running on HXE

This readme describes how to debug an application that is deployed to a HXE instance of the HANA XSA.

  • xs enable-debugging fsdmds_ht-srv (This is an example. Enter the name of the app you want to debug. These can be found via xs a
  • In Chrome call chrome://inspect
  • Click "Open dedicated DevTools for Node"
  • Menu: Connection -> Choose 'Add connection' and enter 'localhost:'
@htammen
htammen / btp_accesstoken
Last active November 24, 2021 07:38
Retrieve an access token for a btp cf app
#!/bin/bash
# Get BTP OAuth access token
# Usage:
# btp_accesstoken <appname>
#
# Call this bash script with btp_accesstoken <appname> where appname is a name
# of your apps on btp.
# You can retrieve the list of apps with 'cf a'
# Login credentials are retrieved from bitwarden. You have to be logged into it already
# client_id, client_secret, oauth endpoint are retrieved from 'cf de <appname>'. You have to be looged into it as well.
@htammen
htammen / cVimrc
Last active February 25, 2022 19:09
cVimrc settings
set noautofocus
# test