Skip to content

Instantly share code, notes, and snippets.

View kiran-machhewar's full-sized avatar

Kiran Machhewar kiran-machhewar

View GitHub Profile
<aura:event type="APPLICATION" description="Event template" >
<aura:attribute name="data" type="Object"/>
</aura:event>
<aura:event type="APPLICATION" description="Event template" >
<aura:attribute name="data" type="Object"/>
</aura:event>
({
initialize : function(component, event, helper) {
var action = component.get("c.getContacts");
var self = this;
action.setCallback(this, function(a) {
var contacts = a.getReturnValue();
component.set("v.contacts", contacts);
console.log('Contacts are loaded.');
});
$A.enqueueAction(action);
public with sharing class LightningOutExampleController {
@AuraEnabled
public static List<Contact> getContacts(){
return [SELECT Id, Name From Contact ];
}
}
<aura:component controller="LightningOutExampleController">
<aura:attribute name="contacts" type="Contact[]" default="[]"></aura:attribute>
<aura:handler name="init" value="{!this}" action="{!c.initialize}" />
<aura:handler event="c:lightningAppEvent" action="{!c.lightningAppEventHandler}"/>
<aura:registerEvent name="lightningAppExternalEvent" type="c:lightningAppExternalEvent" />
<aura:iteration items="{!v.contacts}" var="contact">
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
@kiran-machhewar
kiran-machhewar / SFCompareController
Last active October 6, 2018 12:52
Controller for SFCompare.page
/**
* @ApexClass : SFCompareController
* @Description : This provides services to SFCompare page, which can be accessed by js remoting. It provides below services.
* 1. Logging into SF orgs for obtaining session and instance url.
* 2. Fetches code from the SF org.
* */
public class SFCompareController {
/**
* @description : This method does the login to sf orgs and provides session id and
@kiran-machhewar
kiran-machhewar / SFCompare.page
Created February 14, 2015 14:11
Code Comparison Utility Page
<!--
This page has functionality to compare code from two different orgs.
Here following libraries are used.
Select2 : Gibhub: http://select2.github.io/
Mergely : An Awesome code comparison javascript library by jamie.peabody@gmail.com
Github: https://github.com/wickedest/Mergely
JQuery and Bootstrap
-->
<apex:page sidebar="false" controller="SFCompareController" showHeader="false" standardStylesheets="false">
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/>
public class Notification{
/**
* @description :
* @param jobName Name of the scheduler
* @param durationInMinutes Greater duration than the time interval between scheduler executions.
*/
public static void addNotificationFor(String jobName, Integer durationInMinutes){
Notification__c notification = new Notification__c(
Name = jobName,
External_Code__c = jobName,
public class Notification{
/**
* @description :
* @param jobName Name of the scheduler
* @param durationInMinutes Greater duration than the time interval between scheduler executions.
*/
public static void addNotificationFor(String jobName, Integer durationInMinutes){
Notification__c notification = new Notification__c(
Name = jobName,
External_Code__c = jobName,