Skip to content

Instantly share code, notes, and snippets.

Avatar
🏗️
making things

Jamie Smith jsmithdev

🏗️
making things
View GitHub Profile
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
@jsmithdev
jsmithdev / slds-grid-common.html
Created Nov 22, 2020
slds grid commonly used / simple
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>
@jsmithdev
jsmithdev / lwc-toast.js
Last active Aug 25, 2020
Toast util JS file for LWC's
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+ '"';
}
@jsmithdev
jsmithdev / UploadFile.html
Created Jun 24, 2020 — forked from douglascayers/UploadFile.html
JavaScript snippet for uploading fille to Salesforce as ContentVersion and sharing to record as ContentDocumentLink via jsforce and jquery.
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>
@jsmithdev
jsmithdev / atob.js
Last active Jun 23, 2020 — forked from jmshal/atob.js
Node.js ponyfill for atob and btoa encoding functions
View atob.js
const atob = a => Buffer.from(a, 'base64').toString('binary')
module.exports = { atob }
@jsmithdev
jsmithdev / delay.js
Created Jun 20, 2020 — forked from eteeselink/delay.js
ES7 async/await version of setTimeout
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();
@jsmithdev
jsmithdev / IsCommunity_APEX.cls
Created May 29, 2020
find out if lwc etc is running in commmunity
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){
@jsmithdev
jsmithdev / AWS.cls
Created May 17, 2020 — forked from brianmfear/AWS.cls
Abstract AWS implementation in Apex Code
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;