Skip to content

Instantly share code, notes, and snippets.

Avatar
🎖️
Never Quit

Arun Jacob jakes2255

🎖️
Never Quit
View GitHub Profile
@jakes2255
jakes2255 / JsObjects.js
Created Apr 23, 2021
JS Create Object without prototypes
View JsObjects.js
const obj = Object.create(null);
console.log(obj.__proto_ === null);
View NaNCheck.js
if(isNaN(mobNum)){
MessageToast.show("Only numbers please!");
input.setValue(mobNum.substring(0,mobNum.length-1));
}
View Decimals.js
if(mobNum.indexOf('.')!=-1){
MessageToast.show("No decimal values please!");
input.setValue(mobNum.substring(0,mobNum.length-1));
}
View InputTypeNumber.xml
<Input id="mobnput" class="sapUiSmallMarginBottom" placeholder="Enter mobile number..."
width="170px" value="" liveChange="onMobNumberChange" type="Number"/>
View InputLengthRestrict.js
onMobNumberChange: function (oEvent) {
var input = oEvent.getSource(),
mobNum = input.getValue();
if(mobNum.length > 10){
MessageToast.show("Upto 10 digits only!");
input.setValue(oEvent.getParameters().value.substr(0,10).trim());
}
else{
input.setValue(mobNum);
}
View InputValidationWithRegEx.js
onMobNumberChangeRegEx: function (oEvent) {
var input = oEvent.getSource();
var mobNum = input.getValue();
mobNum = mobNum.replace(/[^\d]/g, '');
input.setValue(mobNum);
}
@jakes2255
jakes2255 / test.ipynb
Last active Mar 29, 2020 — forked from codebrain001/namedtuple.ipynb
A tactile guide to Python Collections
View test.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View callback.js
function first(temp,callBack){
setTimeout(function(){
console.log(temp);
callBack();
},500);
//callBack();
}
function second(){
console.log(2);
}
View test.py
if(itemNumber == 0):
mailSubject = itemDetails
View test.py
sign_content ="<br/>"+"Thanks,"+"<br/>"+"Jakes"