Skip to content

Instantly share code, notes, and snippets.

View jasper07's full-sized avatar

John Patterson jasper07

View GitHub Profile
import http from 'k6/http'
import { check, group, sleep } from "k6";
import { Counter, Rate, Trend } from "k6/metrics";
const URL_LAUNCHPAD = 'https://secondphase.launchpad.cfapps.ap10.hana.ondemand.com';
// 1. init code
export let options = {
// stages: [
// { target: 200, duration: "1m" },
@jasper07
jasper07 / uploadMtaTMS
Last active November 2, 2022 11:03
alternative to tmsUpload - add a MTA file to BTP Cloud Transport Node
const FormData = require('form-data');
const fs = require('fs');
const qs = require('qs');
const axios = require('axios');
// const dotenv = require('dotenv');
// dotenv.config();
const TMS_API = 'https://transport-service-app-backend.ts.cfapps.ap10.hana.ondemand.com/v2';
const TOKEN_URL = 'https://secondphasetooling.authentication.ap10.hana.ondemand.com/oauth/token';
const CLIENT_ID = process.env.CLIENT_ID;
@jasper07
jasper07 / node-hdb-async.js
Last active May 26, 2021 14:36
SAP HANA Database Client for Node working with ES6 Async Await
'use strict';
var util = require('util');
var client = require('./client');
var fields = ['SCHEMA_NAME || \'.\' || TABLE_NAME as TABLE'];
var sql = util.format('select top 5 %s from TABLES', fields.join(','));
const connect = async () =>
await client.connect();
@jasper07
jasper07 / gist:c9e6d173ec6fbfc2d2f8c51c8528044e
Created January 27, 2018 11:28
SAP HANA Database Client for Node working with ES6 Async Await and promises
'use strict';
var util = require('util');
// var async = require('async');
var client = require('./client');
var fields = ['SCHEMA_NAME || \'.\' || TABLE_NAME as TABLE'];
var sql = util.format('select top 5 %s from TABLES', fields.join(','));
const connect = async () =>
await client.connect();
@jasper07
jasper07 / myentityset_update_entity
Created March 25, 2017 22:10
Example of ABAP DPC_EXT code for mapping bapi warning to UI5 field without an Exception
METHOD myentityset_update_entity.
io_data_provider->read_entry_data( IMPORTING es_data = er_entity ).
*--- get the context path from the request uri
DATA(lt_headers) = /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( )->get_request_header( ).
DATA(lv_request_uri) = lt_headers[ name = '~request_uri' ]-value.
DATA(lv_context_path) = match( val = lv_request_uri regex = `/([^\/]+)\/?$` ).
DATA(lv_message_target) = lv_context_path && |/Field1|. "/MyEntity('Key')/Field1
sap.ushell.Container.getService("CrossApplicationNavigation").toExternal({
target: {
semanticObject: "SalesOrder",
action: "display"
},
params: { "param1" : encodeURIComponent(param1) },
appSpecificRoute: '#' + '/SalesOrder/' + sOrder + '/' + sItem
})
@jasper07
jasper07 / initMockServer.js
Last active August 29, 2015 14:13
Add own Request to MockServer
//initialize the MockServer as per normal
jQuery.sap.require("sap.ui.core.util.MockServer");
var oMockServer = new sap.ui.core.util.MockServer({
rootUri: sServiceUrl
});
oMockServer.simulate("model/metadata.xml", "model/");
//add your requests to the ones already set
try {
jQuery.sap.require("myapp.model.mockRequests");
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script id="sap-ui-bootstrap"
type="text/javascript"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_bluecrystal"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js">
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script id="sap-ui-bootstrap"
type="text/javascript"
data-sap-ui-libs="sap.ui.commons"
data-sap-ui-theme="sap_bluecrystal"
@jasper07
jasper07 / gist:73617e14ad21192d37b4
Created July 17, 2014 01:48
build a component-preload.js using gulp
component-preload.js looks like
jQuery.sap.registerPreloadedModules({
"name": "<myApp>Component-preload",
"version": "X.X",
"modules": <minfied module content as kvp>
});
step 1. recursively minify all the apps modules you want to pre load, Instead of writing them to file write them into javascript object