Skip to content

Instantly share code, notes, and snippets.

View qmacro's full-sized avatar

DJ Adams qmacro

View GitHub Profile
@qmacro
qmacro / neo-app.json
Created September 17, 2016 11:04
sitMAN Workshop
{
"routes": [
{
"path": "/d/pos",
"target": {
"type": "destination",
"name": "public-odata-services"
},
"description": "Public OData Services"
},
#!/usr/bin/env node
var stdin = process.stdin,
stdout = process.stdout,
aConfigLines = [],
https = require('https'),
sDocuRoot = "https://help.hana.ondemand.com/webide/",
sDocuPage = "233396e994584fe9b4c7ab6cb2798640.html";
// Read in current .eslintrc.ext config from STDIN
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<title>Relative Dates</title>
<script id="sap-ui-bootstrap"
type="text/javascript"
@qmacro
qmacro / recordequality.js
Created February 3, 2015 14:14
Test equality of record structures as maps, in JavaScript, using reduce. Assuming maps have same structure.
var map1 = {name: "DJ", colour: "green"};
var map2 = {name: "DJ", colour: "green"};
Object.keys(map1).reduce(function(bool, prop) {
return bool && map1[prop] === map2[prop];
}, true); // => true
map2.name = "Joseph";
Object.keys(map1).reduce(function(bool, prop) {
@qmacro
qmacro / data.json
Last active August 29, 2015 14:12
Functional JavaScript scratchpad
// Test data only, sourced from a JSON/YAML style data set; this
// is not realistic in production as the data would be normalised
// and the repetitive nature would be avoided, but it's a reality
// when you're setting up test data by hand, so valid. This data
// is referred to later as "d.employees"
[
{
"name":"Employee Zero",
"wbses":[
@qmacro
qmacro / gist:297c350acc770cdc7013
Last active August 29, 2015 14:10
OTT FP in #UI5?
// Get a list of all the aggregated pages in a SplitApp
// ----------------------------------------------------
// oSplitAppControl is a ref to the instantiated SplitApp
// with an XML View in the masterPages aggregation
// and two XML Views in the detailPages aggregation
["getMasterPages", "getDetailPages"]
// Call the relevant functions to get the master & detail page aggregations content
.map(function(fn) {
*&---------------------------------------------------------------------*
*& Report UI5_REPOSITORY_LOAD
*&
*&---------------------------------------------------------------------*
*&
*& This report implements the up- and download of a SAPUI5 application
*& into an UI5 Repository.
*&
*& Furthermore it is possible to delete a UI5 Repository
*&
@qmacro
qmacro / MultiComboBox-without-Keyed-Root.html
Last active August 29, 2015 14:04
Keyed vs Non-Keyed Root JSON Element
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<script id="sap-ui-bootstrap"
type="text/javascript"
src="/sapui5/latest/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
@qmacro
qmacro / 0_reuse_code.js
Created March 9, 2014 18:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@qmacro
qmacro / CheckboxColumnBinding.html
Created February 4, 2014 08:34
Checkbox and Column Visibility binding
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<title>Checkbox and Column Binding</title>
<script id="sap-ui-bootstrap"
type="text/javascript"