Skip to content

Instantly share code, notes, and snippets.

Avatar
🎖️
Never Quit

Arun Jacob jakes2255

🎖️
Never Quit
View GitHub Profile
View test.py
#Open the file and pass data to be written.
file1 = open(completeName, "w")
toFile = "SCN: Questions of the Day!"+\
"\n"+"**************************""\n"
file1.write(toFile)
View test.py
# loop for retrieving div tags
for eachDiv in divs:
hrefS = re.findall(r'title=(.*?)>', str(eachDiv))
for hRef in hrefS: # loop for retrieving only titles in the relevent divs
print(hRef)
View model.js
onPressAdd: function () {
//retrive model using helper function in base class
var oJsonModel = this.getMyModel("Results");
//create an additional node to be added to the model
var additional_props = {
"organization": "SAP",
"place": "Bangalore"
};
//add the new node to the current model
oJsonModel.setProperty("/address",additional_props);
@jakes2255
jakes2255 / controller.js
Created Aug 22, 2019
Custom Controller
View controller.js
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function (Controller) {
"use strict";
return Controller.extend("com.demo.ZDemo_CustomPath.controller.Display", {
onInit: function () {
}
});
View index.html
<!DOCTYPE html>
<html>
<head>
<script
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-bindingSyntax="complex">
</script>
@jakes2255
jakes2255 / index.js
Created Jul 25, 2019
My Custom NPM package
View index.js
module.exports = function(string) {
if(typeof string !== "string") throw new TypeError("Plesae enter a string value!");
return string.replace(/\s/g,"");
};
@jakes2255
jakes2255 / router.html
Created Jul 22, 2019 — forked from joakimbeng/router.html
A really simple Javascript router
View router.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:
View View1.view.xml
<mvc:View controllerName="com.study.Z_HttpRequests.controller.View1" xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
<Shell id="shell">
<App id="app">
<pages>
<Page id="page" title="{i18n>ajaxTitle}">
<content>
<List class="sapUiResponsiveMargin" width="auto" items="{httpModel>/}">
<items>
<ObjectListItem title="User ID: {httpModel>userId}" numberUnit="{httpModel>title}"
intro="{httpModel>body}" number="ID: {httpModel>id}"/>