Skip to content

Instantly share code, notes, and snippets.

View jsmithdev's full-sized avatar
🏗️
building things

Jamie Smith jsmithdev

🏗️
building things
View GitHub Profile
@jsmithdev
jsmithdev / atob.js
Last active June 23, 2020 19:39 — forked from jmshal/atob.js
Node.js ponyfill for atob and btoa encoding functions
const atob = a => Buffer.from(a, 'base64').toString('binary')
module.exports = { atob }
@jsmithdev
jsmithdev / UploadFile.html
Created June 24, 2020 06:39 — forked from douglascayers/UploadFile.html
JavaScript snippet for uploading fille to Salesforce as ContentVersion and sharing to record as ContentDocumentLink via jsforce and jquery.
<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 / xmlToJson.js
Last active September 1, 2021 03:47 — forked from chinchang/xmlToJson.js
Function to convert XML to JSON
/*
Usage:
1. If you have an XML file URL:
const response = await fetch('file_url');
const xmlString = await response.text();
var XmlNode = new DOMParser().parseFromString(xmlString, 'text/xml');
xmlToJson(XmlNode);
@jsmithdev
jsmithdev / remove console log webpack.md
Created September 21, 2021 12:54 — forked from rupeshtiwari/remove console log webpack.md
remove console.log & comments from code webpack

Remove Console Log From Prod Bundle using Webpack

This will help you to remove console.log and comments from typescript or javascript files using webpack 4

Install uglifyjs-webpack-plugin

webpack remove console.log

npm i npm install uglifyjs-webpack-plugin --save-dev

create bs-module-app\webpack\webpack-optimization.config.js

@jsmithdev
jsmithdev / SOQL Queries.sql
Created January 24, 2023 02:43 — forked from sholloway/SOQL Queries.sql
Useful SOQL queries for exploring a Salesforce org.
--------------------------------------------------------------------
-- Queries related to distribution of metadata.
-- Find the number of users per profile.
SELECT count(id), Profile.name
FROM User
WHERE User.IsActive = true
GROUP BY Profile.name
-- Find the distribution of Apex classes per namespace.
select count(id), NameSpacePrefix