Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
swapnilshrikhande / LightningRecordEditForm.xml
Created February 16, 2021 12:22 — forked from sfcure/LightningRecordEditForm.xml
This is a working example of rendering Lightning:RecordEditForm dynamically as per object's page layout
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="LightningRecordEditFormController">
<aura:attribute name="disabled" type="Boolean" default="false" />
<aura:attribute name="layoutSections" type="List" />
<aura:attribute name="saved" type="Boolean" default="false" />
<aura:attribute name="showSpinner" type="Boolean" default="true" />
<aura:attribute name="fieldName" type="String" default="StageName" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<lightning:card title="">
@swapnilshrikhande
swapnilshrikhande / HttpMock.cls
Created November 2, 2020 13:23 — forked from rsoesemann/HttpMock.cls
apex-http-mock
@IsTest
public class HttpMock implements HttpCalloutMock {
private static final String ANY_URL = null;
private Map<String, Map<String, Object>> responses = new Map<String, Map<String, Object>>();
// PUBLIC
@swapnilshrikhande
swapnilshrikhande / public-stun-list.txt
Created July 1, 2019 12:20 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
const ws = new WebSocket('ws://localhost:8080')
ws.onopen = () => {
console.log('Connected to the signaling server')
}
ws.onerror = err => {
console.error(err)
}
@swapnilshrikhande
swapnilshrikhande / arabic_transliteration.php
Created November 23, 2017 16:15 — forked from zekizeki/arabic_transliteration.php
A php script to provide simple english->arabic arabic->english transliteration
<?php
/*
* Created on 05-Jul-2006
* rob.s.smart@gmail.com
* Translator class calls external machine translation component
*/
class Phonetics
{
@swapnilshrikhande
swapnilshrikhande / ControllerMethods
Created October 17, 2017 14:49 — forked from anonymous/ControllerMethods
Zip Multiple Files
@RemoteAction
public static List<AttachmentWrapper> getAttachedDocsList(String pParentOpportunityId) {
/*
Set<Id> parentDocIdSet = new Set<Id>();
for(Document__c docObj : opp.Documents__r) {
parentDocIdSet.add(docObj.Linked_Document__c);
}
system.debug('>>> parentDocIdSet: '+parentDocIdSet);
*/
@swapnilshrikhande
swapnilshrikhande / QueryGenerator.cls
Created October 15, 2017 15:11 — forked from anonymous/QueryGenerator.cls
Query Generator From FieldList
// Class which contains useful utility methods required across classes
public class Utils {
public static final String OBJECTNAME = 'RELATIONSHIP_OBJECT';
public static final String FIELDNAME = 'RELATIONSHIP_FIELD';
public static final String QUERY_TEMPLATE = 'SELECT {0} FROM {1} {2}';
public static final String NESTED_QUERY = '({0})';
public static final String COMMA_SEPARATOR = ', ';
public static final String FIELD_ID = 'Id';
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.WebElement;
import com.github.webdriverextensions.junitrunner.WebDriverRunner;
import com.github.webdriverextensions.junitrunner.annotations.*;
import static com.github.webdriverextensions.Bot.*;
import static java.util.concurrent.TimeUnit.SECONDS;
@swapnilshrikhande
swapnilshrikhande / TriggerEvent.js
Created July 26, 2017 08:43 — forked from anonymous/TriggerEvent.js
Trigger the Change Event using plain js
function triggerChangeEvent(element){
if ("createEvent" in document) {
var evt = document.createEvent("HTMLEvents");
evt.initEvent("change", false, true);
element.dispatchEvent(evt);
}
else
element.fireEvent("onchange");
@swapnilshrikhande
swapnilshrikhande / WebDriverExtensionsGroovyExampleTest.groovy
Created June 27, 2017 09:55 — forked from andidev/WebDriverExtensionsGroovyExampleTest.groovy
Example of a WebDriver Extensions Test written in Groovy
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.WebElement;
import com.github.webdriverextensions.junitrunner.WebDriverRunner;
import com.github.webdriverextensions.junitrunner.annotations.*;
import static com.github.webdriverextensions.Bot.*;
import static java.util.concurrent.TimeUnit.SECONDS;