Skip to content

Instantly share code, notes, and snippets.

Matt Smith AllThingsSmitty

Block or report user

Report or block AllThingsSmitty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
AllThingsSmitty /
Last active Jan 13, 2020
Salesforce DX steps, tips, and tricks

Initial Set-Up

Authenticate with Dev Hub (one time)

The Dev Hub is our production org. Scratch orgs are registered against a Dev Hub and can be managed from there. Execute the following command in a terminal (you'll be prompted to enter your username and password in a browser window):

  • sfdx force:auth:web:login --setdefaultdevhubusername -a Unum_DevHub

Set Your Default Dev Hub Username

It's possible to have multiple Dev Hub orgs. If you want to change to a different Dev Hub, you must specify your defaultdevhubusername setting with this command:

AllThingsSmitty / code-highlight.css
Created Oct 31, 2017
CSS for highlighting code
View code-highlight.css
pre {
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
padding: 3px;
code {
white-space: nowrap;
AllThingsSmitty / css-reset.css
Created Oct 18, 2017
Snippet for CSS reset
View css-reset.css
*:after {
box-sizing: border-box;
margin: 0;
padding: 0;
AllThingsSmitty / system-fonts.css
Created Jul 12, 2017
Snippet for system fonts
View system-fonts.css
body {
font-family: -apple-system,
"Segoe UI",
"Helvetica Neue",
AllThingsSmitty / flexbox-center-container.css
Created Jul 7, 2017
Snippet for vertical-/horizontal-aligned container
View flexbox-center-container.css
html, body {
height: 100%;
margin: 0;
body {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
AllThingsSmitty /
Created Dec 20, 2016 — forked from mdo/
Example of how to embed a Gist on GitHub Pages using Jekyll.

Here's an example of how to embed a Gist on GitHub Pages:

{% gist 5555251 %}

All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.

AllThingsSmitty / toggle.js
Created Oct 13, 2016
Toggle show/hide password
View toggle.js
function togglePassword() {
let passwordInput = document.getElementById('txtPassword');
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
} else {
passwordInput.type = 'password';
(function () {
View disable-right-click.js
// credit: Louis Lazaris
window.addEventListener('contextmenu', function (e) {
console.log('context menu disabled');
}, false);
document.addEventListener('mouseup', function (e) {
if (e.button === 2) {
console.log('right-click enabled');
AllThingsSmitty / flexible-type.css
Last active Feb 21, 2017
Use :root for flexible type
View flexible-type.css
/* This has been added to CSS Protips */
/* The type font size in a responsive layout should be able to adjust with each viewport.
You can calculate the font size based on the viewport height and width using :root */
:root {
font-size: calc(1vw + 1vh + .5vmin);
/* Now you can utilize the root em unit based on the value calculated by :root */
body {
AllThingsSmitty / font-awesome-loaded.js
Created Apr 24, 2016
Dynamically check if Font Awesome CDN loaded
View font-awesome-loaded.js
function css(element, property) {
return window.getComputedStyle(element, null).getPropertyValue(property);
window.onload = function () {
var span = document.createElement('span');
span.className = 'fa'; = 'none';
document.body.insertBefore(span, document.body.firstChild);
You can’t perform that action at this time.