Skip to content

Instantly share code, notes, and snippets.

Avatar
👩‍💻

Shruti Sridharan shrutis22

👩‍💻
View GitHub Profile
@shrutis22
shrutis22 / CloudBit.java
Created Mar 4, 2016
To make API calls to CloudBit server to Switch ON/OFF a device
View CloudBit.java
/**
* This class is created to
* make API Calls to CloudBits
* Server
*
* @author Shruti Sridharan
* @since 28/02/2016
* @revisions N/A
*/
global class CloudBit {
@shrutis22
shrutis22 / Switch_ON.java
Created Mar 7, 2016
Switch ON Button - CloudBit
View Switch_ON.java
{!REQUIRESCRIPT("/soap/ajax/36.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/36.0/apex.js")}
var obj = {
"percent" : 100,
"duration" : -1,
"recId" : "{!LittleBit__c.Id}"
};
sforce.apex.execute( "CloudBit" , "toggle" , obj );
@shrutis22
shrutis22 / Switch_OFF.java
Created Mar 7, 2016
Switch OFF - CloudBit
View Switch_OFF.java
{!REQUIRESCRIPT("/soap/ajax/36.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/36.0/apex.js")}
var obj = {
"percent" : 0,
"duration" : 3000,
"recId" : "{!LittleBit__c.Id}"
};
sforce.apex.execute( "CloudBit" , "toggle" , obj );
@shrutis22
shrutis22 / GoogleUrlShortener.java
Created Mar 7, 2016
Google URL Shortener API to shorten long URLs
View GoogleUrlShortener.java
/**
* This class exposes methods
* that calls the Google URL
* Shortener API to shorten long URLs.
*
* @author Shruti Sridharan
* @since 22/02/2016
* @version 1.0
*/
global class GoogleUrlShortener {
View BookmarksController.java
/**
* This class is created to
* save Bookmarks in a
* specific category.
*
* @author Shruti Sridharan
* @since 26/02/2016
* @revision N/A
*/
global class BookmarksController {
@shrutis22
shrutis22 / NewsWidgetController.cls
Created Jul 15, 2016
Sends search string to Google News Class which in turn makes an API Request to Google News Servers
View NewsWidgetController.cls
/**
* This class is created to call
* Google News Generating class
* and display in the VisualForce
* Page.
*
* @author Shruti Sridharan
* @since 08/03/2016
* @version 1.0
* @revisons N/A
@shrutis22
shrutis22 / GoogleNews.cls
Created Jul 15, 2016
Calls Google APIS to get Google News
View GoogleNews.cls
/**
* This class exposes methods
* that call Google APIs to
* get news.
*
* @author Shruti Sridharan
* @since 08/03/2016
* @version 1.0
* @revisons N/A
*/
@shrutis22
shrutis22 / NewsWidget.html
Last active Jul 15, 2016
The News page which will be displayed as an inline VF page in Account detail page.
View NewsWidget.html
<apex:page standardController="Account" extensions="NewsWidgetController" sidebar="false" showHeader="false" standardStylesheets="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" >
<html>
<head>
<title>
Google News
</title>
</head>
<body>
<div width="100%" style="text-align:center" >
<img src="{!$Resource.News_Loading}" id="loader"></img>
@shrutis22
shrutis22 / GoogleNewsJS.js
Last active Jul 15, 2016
Javascript file created to parse the XML Response Body
View GoogleNewsJS.js
/**
* [1] Will be fired when the Apex
* Method completes execution.
*
* [2] Will also hold the data returned
* by the Apex Method after it
* completes execution.
*/
var searchTerm;
var newsFetchCompleted = function( res ) {
@shrutis22
shrutis22 / asideCodeFolding.js
Created Jul 24, 2016
Perform Code Folding in ASIDE.IO (A cloud based Salesforce IDE)
View asideCodeFolding.js
// ==UserScript==
// @name Expand/Collapse nodes in ASIDE.IO
// @version 1.0
// @description Perform Code Folding in ASIDE.IO (A cloud based Salesforce IDE)
// @author Shruti Sridharan
// @match https://www.aside.io/*
// @grant https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js
// @namespace https://greasyfork.org/users/56475
// ==/UserScript==