Skip to content

Instantly share code, notes, and snippets.

View VijayaSankarN's full-sized avatar

Vijaya Sankar N VijayaSankarN

View GitHub Profile
@VijayaSankarN
VijayaSankarN / AWS Solution Architect Associate.md
Last active April 20, 2017 02:37
AWS Solution Architect Associate - Exam Preparation

My Notes for AWS Solution Architect Associate

@VijayaSankarN
VijayaSankarN / Config.php
Created July 11, 2017 13:00
PHP INI parser with environment based reading
<?php
class Config
{
private static $environments = ['dev', 'qa', 'prod'];
private static $filenames = ['assets', 'libraries'];
private static $filepath = "/";
private static $environment = NULL;
private static $file_data = NULL;
@VijayaSankarN
VijayaSankarN / sharepointRESTService.js
Created July 24, 2017 11:40
SharePoint - Angular REST API base class for lists
(function() {
angular.module('myApp').factory('sharepointRESTService', sharepointRESTService)
sharepointRESTService.$inject = ['$q', '$http', '$location'];
function sharepointRESTService($q, $http, $location) {
var factoryUtil = {};
var domain_url = "https://company_name.sharepoint.com/sites/site_name";
// HTTP GET
@VijayaSankarN
VijayaSankarN / My Sublime Plugins List.md
Last active August 1, 2017 12:29
My Sublime Plugins List

My Sublime Plugins

  1. DocBlocker : Block comments / Documentation
  2. Emmet : Auto fill HTML Eg: ul>li*5
  3. Gist : Creating new gists from Sublime
  4. Package Control
  5. Select Quoted : Select texts inside quotes
  6. MarkdownEditing : Edit md files
  7. SideBarEnhancements
  8. SublimeCodeIntel : Sublime autocomplete
@VijayaSankarN
VijayaSankarN / FizzBuzz.php
Created January 9, 2019 09:02
Fizz Buzz Test
for($i=1;$i<100;$i++) {
echo ($i%3?'':'Fizz').($i%5?'':'Buzz')?:$i,"<br/>";
}
@VijayaSankarN
VijayaSankarN / str_ireplace_n.php
Last active March 14, 2020 16:08
String replace nth occurrence - case-insensitive using PHP
<?php
/**
* String replace nth occurrence - case-insensitive
*
* @param type $search Search string
* @param type $replace Replace string
* @param type $subject Source string
* @param type $occurrence Nth occurrence
* @return type Replaced string
*/
@VijayaSankarN
VijayaSankarN / BooleanExpression.cls
Created July 5, 2018 06:31
Apex class to evaluate a Boolean expression
/***************************************************************************************************
* Class Name : BooleanExpression
* Created Date : July 4, 2018
* Author : Vijaya Sankar N
* Description : Class to evaluate a boolean expression
* Example : (TRUE AND (FALSE OR TRUE)) is TRUE
****************************************************************************************************/
public class BooleanExpression {
static Map<String, String> logicTypes = new Map<String, String>();
static Map<String, Map<String, String>> expressionLogic = new Map<String, Map<String, String>>();
@VijayaSankarN
VijayaSankarN / ResponsiveLightningDataTable.css
Last active September 17, 2020 12:45
Responsive Table that convers Table Columns to Rows along with Labels
/* RESPONSIVE LIGHTNING DATATABLE - SALESFORCE (With Checkbox)
* https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/example
*/
@media (max-width: 768px) {
.THIS lightning-datatable.responsive-table thead th:not(:first-child) {
display: none;
}
.THIS lightning-datatable.responsive-table thead th:first-child .slds-checkbox:after {
content: 'Select All';
%%[
/* Replace with your list ID */
SET @ListID = "<YOUR_ID>"
SET @SubscriberKey = "<Subscriber_Key>"
SET @rr = CreateObject("RetrieveRequest")
SetObjectProperty(@rr,"ObjectType","ListSubscriber")
AddObjectArrayItem(@rr,"Properties","SubscriberKey")
AddObjectArrayItem(@rr,"Properties","ListID")
<script runat="server">
Platform.Load("core", "1");
var prox = new Script.Util.WSProxy();
try {
var DE = "DataExtensionObject[MyDataExtension]", // Replace 'MyDataExtension' with your Data Extension Name
options = {SaveOptions: [{'PropertyName': '*', SaveAction: 'UpdateAdd'}]},
cols = ["EmailAddress", "SubscriberKey"], // Replace the field names matching your Data Extension
moreData = true,
reqID = null,
numItems = 0;