This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A utility class to help when dealing with SObjects. | |
* | |
* @author Logan Moore | |
*/ | |
public with sharing class SObjectUtil | |
{ | |
/** | |
* Given two SObjects and a list of fields to compare, this method tells | |
* you if the list of fields are the same on both SObjects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// Example implementation as follows: | |
public class AWSS3_GetService extends AWS { | |
public override void init() { | |
endpoint = new Url('https://s3.amazonaws.com/'); | |
resource = '/'; | |
region = 'us-east-1'; | |
service = 's3'; | |
accessKey = 'my-key-here'; | |
method = HttpMethod.XGET; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<ul id="category"> | |
<li id="laptop">Laptop</li> | |
<li id="cameras">Camera</li> | |
<li id="shoes">Shoes</li> | |
</ul> | |
</div> | |
<div id="form"> | |
<input type="text" id="name" data-uppercase/> | |
<input type="text" id="pan"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="grnadParent"> | |
<div id="parent"> | |
<div id="child"></div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Some Title</title> | |
</head> | |
<body> | |
<h1>This is hello world</h1> | |
<input type="text" onkeyup="betterFuntion()"/> | |
<script src="./index.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Function Currying | |
let multiply = function (x, y) { | |
console.log (x*y); | |
} | |
let multiplyByTwo = multiply.bind (this, 2); | |
multiplyByTwo (5); | |
//Function Currying |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let nameObj = { | |
firstName : 'SK', | |
lastName : 'cool' | |
} | |
let printName = function () { | |
console.log (`${this.firstName} - ${this.lastName}`); | |
} | |
//task is to create own implementatio of bind | |
let printMyName = printName.bind (name) | |
printMyName(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let name = { | |
firstName : 'sudar', lastName : 'Test', | |
printFullName : function () { | |
console.log (`${this.firstName}-${this.lastName}`) | |
} | |
} | |
name.printFullName(); | |
//Function Borrowing | |
let name = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An utility class to parse XML and create the equivalent JSON | |
@author - unknown | |
*/ | |
public class XMLParser { | |
// To find the root element so that we can enclose it in the curly braces | |
public static String rootElementName; | |
/* Method which is parsing the XML content into JSON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($A.get("$Browser.formFactor") === 'PHONE') { | |
$A.createComponent( | |
"aura:html", | |
{ | |
"aura:id": "styleTag", | |
"tag": "style", | |
"body": '.overLayCustomStyles {overflow : scroll; height:' + ($(window).height() - 173) + 'px;}' | |
}, | |
function(newHtml, status, errorMessage){ | |
//Add the new button to the body array |
NewerOlder