Skip to content

Instantly share code, notes, and snippets.

View shrutis22's full-sized avatar
👩‍💻

Shruti Sridharan shrutis22

👩‍💻
View GitHub Profile
@shrutis22
shrutis22 / CloudBit.java
Created March 4, 2016 05:25
To make API calls to CloudBit server to Switch ON/OFF a device
/**
* 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 March 7, 2016 05:07
Switch ON Button - CloudBit
{!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 March 7, 2016 05:08
Switch OFF - CloudBit
{!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 March 7, 2016 08:50
Google URL Shortener API to shorten long URLs
/**
* 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 {
@shrutis22
shrutis22 / BookmarksController.java
Created March 7, 2016 11:03
Bookmarks Controller
/**
* 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 July 15, 2016 06:37
Sends search string to Google News Class which in turn makes an API Request to Google News Servers
/**
* 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 July 15, 2016 06:38
Calls Google APIS to get Google News
/**
* 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 July 15, 2016 18:58
The News page which will be displayed as an inline VF page in Account detail page.
<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 July 15, 2016 19:00
Javascript file created to parse the XML Response Body
/**
* [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 July 24, 2016 12:31
Perform Code Folding in ASIDE.IO (A cloud based Salesforce IDE)
// ==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==