This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Use attributes to configure input accordingly --> | |
| <input type="text" placeholder="Enter number" numbers-only max-number="10" allow-decimals="true" set-decimal-places="3"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pgClient; | |
| exports.setConnection = function(client){ | |
| pgClient = client; | |
| } | |
| /************************************************************************* | |
| *************************** CRUD OPERTIONS *************************** | |
| ************************************************************************/ | |
| exports.getRecords = function(objectApiName, config, callback){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //file.directive.js | |
| (function() { | |
| 'use strict'; | |
| angular | |
| .module('starter.services') | |
| .directive("file",function(){ | |
| return { | |
| scope: { | |
| onFilesSelection: '&', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ### Authenticate Middleware | |
| // authentication has to be done for /ghost/* routes with | |
| // exceptions for signin, signout, signup, forgotten, reset only | |
| // api and frontend use different authentication mechanisms atm | |
| authenticate: function (req, res, next) { | |
| var path, | |
| subPath, | |
| scope; | |
| // SubPath is the url path starting after any default subdirectories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var {google} = require('googleapis'), // official https://github.com/google/google-api-nodejs-client npm module | |
| analyticsreporting = google.analyticsreporting('v4'), | |
| key = require('./private.json');// Secure server key file(in JSON) dowloaded from Google | |
| /********************** GET PAGE VIEWS *******************/ | |
| app.get('/analytics/report', cors(corsOptions), function(req,res){ | |
| //passed parameter | |
| var url = req.query.url; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| 'use strict'; | |
| angular | |
| .module('app.directives') | |
| /** | |
| * @ngdoc filter | |
| * @name filter:formattedDate | |
| * @description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String csvLine = 'Test,Check,[email protected], "19, Link road, A1SH10, India", companyName, "companyStreet, CompanyCity, CompanyCountry"'; | |
| String prevLine = csvLine; | |
| Integer startIndex; | |
| Integer endIndex; | |
| while(csvLine.indexOf('"') > -1){ | |
| if(startIndex == null){ | |
| startIndex = csvLine.indexOf('"'); | |
| csvLine = csvLine.substring(0, startIndex) + ':quotes:' + csvLine.substring(startIndex+1, csvLine.length()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('app.directives') | |
| .directive('focusElement', ['$timeout', function($timeout) { | |
| return { | |
| link: function(scope, element, attrs) { | |
| scope.$watch(attrs.focusElement, function(value) { | |
| if(value === true) { | |
| $timeout(function () { | |
| element[0].focus(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('app.directives') | |
| .directive('arrowKeysIndex', function() { | |
| return { | |
| restrict: 'A', | |
| require: '^ngModel', | |
| link: function (scope, element, attrs) { | |
| element.on('keydown', function(event) { | |
| let currentIndex = attrs.arrowKeysIndex; | |
| let nextIndex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NamedCredentailsExample { | |
| public static String oAuth_flow(){ | |
| return makeCallout('OAuth_flow_Demo/services/apexrest/namedcredentials/demo','GET', null,null); | |
| } | |
| public static String oAuth_flow_Post(String body){ | |
| return makeCallout('OAuth_flow_Demo/services/apexrest/namedcredentials/demo','POST', null,body); | |
| } | |
NewerOlder