Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
swapnilshrikhande / build.xml
Created April 21, 2016 13:50
Deploy salesforce components from one org to another.
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">
<property file="build.properties"/>
<property environment="env"/>
<taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
<classpath>
<pathelement location="../ant-salesforce.jar" />
</classpath>
</taskdef>
@swapnilshrikhande
swapnilshrikhande / tableSorter.js
Last active August 2, 2016 13:44 — forked from mangeshpawar/tableSorter.js
Table Sorting Utility Supporting Standard Salesforce Form Elements
var ts = ts || {};
var sortStatus = {};
ts.getValue = function(tdElem){
var inputElemLst = $(tdElem).find("input:not([type='hidden']):first");
return inputElemLst.length ? inputElemLst.val() : $(tdElem).text();
};
ts.handleSortClick = function(event){
var delay = (function(){
var timer = 0;
return function(callback,param, ms){
clearTimeout (timer);
timer = setTimeout(function(){
callback(param);
}, ms);
};
})();
@swapnilshrikhande
swapnilshrikhande / DeferredTest.class
Created April 26, 2016 09:58
Deferred to wait for two remote actions
public class DeferredTest {
@RemoteAction
public static String remoteActionOne(){
return 'one';
}
@RemoteAction
public static String remoteActionTwo(){
return 'two';
}
@swapnilshrikhande
swapnilshrikhande / function.php
Created April 26, 2016 10:08 — forked from YugalXD/function.php
Send mail with mailgun api by PHP CURL.
<?php
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME');
define('MAILGUN_KEY', 'KEY');
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
'html'=>$html,
@swapnilshrikhande
swapnilshrikhande / validateInputOnKeydown.js
Last active April 27, 2016 15:18
Validate input on key down
<input class="input-field" />
$(".input-field").on("keyup blur",function(event){
var valStr = $(this).val();
if($.trim(valStr) == '.' || $.trim(valStr) == '-'){
return true;
}
if(isNumeric(valStr)){
@swapnilshrikhande
swapnilshrikhande / apex_basix_authentication.cls
Last active April 28, 2016 15:26
AuthCallout basic authentication salesforce
public class AuthCallout {
public void basicAuthCallout(){
HttpRequest req = new HttpRequest();
req.setEndpoint('http://www.yahoo.com');
req.setMethod('GET');
// Specify the required user name and password to access the endpoint
// As well as the header and header information
@swapnilshrikhande
swapnilshrikhande / responsiveTable.css
Last active July 19, 2016 10:40
Responsive Table
/*
Generic Styling, for Desktops/Laptops
Reference : https://css-tricks.com/responsive-data-tables/
*/
table {
width: 100%;
border-collapse: collapse;
}
/* Zebra striping */
tr:nth-of-type(odd) {
@swapnilshrikhande
swapnilshrikhande / event_bubble_demo.html
Last active July 26, 2016 10:35
JQuery Demo Snippets
<!DOCTYPE html>
<html>
<head>
<title></title>
<!--<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>-->
<script src="./jquery-1.11.3.js"></script>
</head>
<style type="text/css">
.target{
@swapnilshrikhande
swapnilshrikhande / SearchNearby_PlacesGoogle.html
Created July 26, 2016 12:24
Search Nearby Places Google
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#map-canvas {
height : 500px;
}
</style>
<title></title>