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
let express = require ('express'); | |
let express_graphql = require('express-graphql'); | |
let {buildSchema} = require ('graphql'); | |
//GraphQL schema | |
var schema = buildSchema (` | |
type Query { | |
course(id: Int!): Course | |
courses(topic: String): [Course] |
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
let express = require ('express'); | |
let express_graphql = require('express-graphql'); | |
let {buildSchema} = require ('graphql'); | |
//GraphQL schema | |
var schema = buildSchema (` | |
type Query { | |
message : String | |
} |
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
<aura:component> | |
<!--- Your component --> | |
</aura:component> |
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
/*Source : | |
https://gomakethings.com/getting-all-query-string-values-from-a-url-with-vanilla-js/ | |
*/ | |
/* @param {String} url The URL | |
* @return {Object} The URL parameters | |
*/ | |
var getParams = function (url) { | |
var params = {}; | |
var parser = document.createElement('a'); |
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 DynamicTabsCntl { | |
@AuraEnabled | |
public static List< foolish__TabsOnLightningComponent__mdt > getData () { | |
return [SELECT Id, foolish__ComponentName__c , DeveloperName, MasterLabel, foolish__IsActive__c ,foolish__Params__c | |
FROM foolish__TabsOnLightningComponent__mdt WHERE foolish__IsActive__c = true]; | |
} | |
} |
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
<!-- TestWsCallout.page --> | |
<apex:page controller="TestWsCallout" tabstyle="Account"> | |
<apex:form > | |
<apex:actionFunction action="{!InsertRecord}" name="InsertRecord_JS" Rerender="statuses" status="Status1" oncomplete="CallWebService_JS();"/> | |
<apex:actionFunction action="{!CallWebService}" name="CallWebService_JS" status="Status2" reRender="statuses, msg"/> | |
<apex:outputPanel id="statuses"> | |
<apex:actionStatus id="Status1" startText="...Inserting Record Into DB..." /> | |
<apex:actionStatus id="Status2" startText="...Calling Web Service..." /> | |
</apex:outputPanel> |
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
fun isEmailValid(email: String): Boolean { | |
return Pattern.compile( | |
"^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]|[\\w-]{2,}))@" | |
+ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" | |
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\." | |
+ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" | |
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9]))|" | |
+ "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$" | |
).matcher(email).matches() | |
} |
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
#table-wrapper { | |
position:relative; | |
} | |
#table-scroll { | |
height:150px; | |
overflow:auto; | |
margin-top:20px; | |
} | |
#table-wrapper table { | |
width:100%; |
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
// ==UserScript== | |
// @name Facebook Posts Deleter 2016 | |
// @namespace com.vsubhash.js.facebook_posts_deleter.2016 | |
// @description Automatically deletes posts from Activity Log of Facebook, one by one. | |
// @include https://www.facebook.com/*=allactivity | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener("DOMContentLoaded", |
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
Http http = new Http (); | |
HttpRequest req = new HttpRequest (); | |
req.setEndPoint ('https://th-apex-http-callout.herokuapp.com/animals'); | |
req.setMethod ('POST'); | |
req.setHeader ('Content-Type', 'application/json;charset=UTF-8'); | |
req.setBody ('{"name":"mighty moose _1"}'); | |
HttpResponse response = http.send(req); | |
if (response.getStatusCode() != 201) { | |
System.debug('The status code returned was not expected: ' + | |
response.getStatusCode() + ' ' + response.getStatus()); |