View sfdx + land short deploy for readme
## Deploy | |
Click to deploy can be done at [https://component.land?share=jsmithdev%2Fsortie-list](https://component.land?share=jsmithdev%2Fsortie-list) | |
SFDX deployment instructions can be found at [https://github.com/jsmithdev/sfdx-deploy-instructions](https://github.com/jsmithdev/sfdx-deploy-instructions) | |
--- | |
coded while petting a 🐶 by [Jamie Smith](https://jsmith.dev) |
View .ignore
.env | |
.history | |
.sfdx | |
scratch.js | |
sfdx-project.json | |
config | |
scripts |
View slds-grid-common.html
<div class="slds-grid slds-gutters"> | |
<div class="slds-col"> | |
<span>1</span> | |
</div> | |
<div class="slds-col"> | |
<span>2</span> | |
</div> |
View lwc-toast.js
import { ShowToastEvent } from 'lightning/platformShowToastEvent' | |
/** | |
* | |
* @param {String} str - String to capitalize the first character | |
* @returns {String} String with first character capitalized | |
*/ | |
export function capitalize(str){ | |
return str.charAt(0).toUpperCase() + str.slice(1) |
View RestService.cls
@RestResource(urlMapping='/RestService/*') | |
global with sharing class RestService { | |
@HttpPost | |
global static String wookiehookie(String data) { | |
System.debug(data); | |
return '"had_data": "' +data+ '"'; | |
} |
View UploadFile.html
<apex:page> | |
<head> | |
<script src="{!$Resource.jquery224}"></script> <!-- https://jquery.com/ --> | |
<script src="{!$Resource.jsforce170}"></script> <!-- https://jsforce.github.io/ --> | |
<script>$j = jQuery.noConflict();</script> | |
</head> | |
<body> | |
<form> |
View atob.js
const atob = a => Buffer.from(a, 'base64').toString('binary') | |
module.exports = { atob } |
View delay.js
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
async function something() { | |
console.log("this might take some time...."); | |
await delay(5000); | |
console.log("done!") | |
} | |
something(); |
View IsCommunity_APEX.cls
@AuraEnabled | |
public static Boolean isCommunity(){ | |
Boolean isCommunity = false; | |
String host = URL.getSalesforceBaseUrl().toExternalForm(); | |
String uri = host.replace('https://', ''); | |
for(Domain d : [SELECT Domain FROM Domain]){ | |
if(d.Domain == uri){ |
View AWS.cls
/* | |
// Example implementation as follows: | |
public class AWSS3_GetService extends AWS { | |
public override void init() { | |
endpoint = new Url('https://s3.amazonaws.com/'); | |
resource = '/'; | |
region = 'us-east-1'; | |
service = 's3'; | |
accessKey = 'my-key-here'; | |
method = HttpMethod.XGET; |
NewerOlder