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
AllThingsSmitty / README.md
Last active Dec 11, 2019
Salesforce DX steps, tips, and tricks
View README.md

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
AllThingsSmitty / rainbow.css
Created Jan 17, 2016
Animated background color shift
View rainbow.css
/* based on dbox.us */
body {
background: linear-gradient(238deg, #fd8800, #fd008f, #9700fd, #003dfd, #05c7e6, #4bd58d);
background-size: 1200% 1200%;
-webkit-animation: rainbow 30s ease infinite;
animation: rainbow 30s ease infinite;
}
@-webkit-keyframes rainbow {
0% { background-position: 0% 50% }
50% { background-position: 100% 50% }
@AllThingsSmitty
AllThingsSmitty / function-performance-test.js
Last active Nov 8, 2019
A quick JavaScript function performance test on the browser console
View function-performance-test.js
var i = performance.now();
yourFunction();
performance.now() - i;
//Or make a helper function, like this:
function performanceTest(testFunction, iterations) {
'use strict';
var sum = 0;
var start = performance.now();
for (var i = 0; i < iterations; i++) {
@AllThingsSmitty
AllThingsSmitty / index.htm
Created Apr 10, 2015
Simple responsive table in CSS (no JS)
View index.htm
<table>
<thead>
<tr>
<th>Payment</th>
<th>Issue Date</th>
<th>Amount</th>
<th>Period</th>
</tr>
</thead>
<tbody>
@AllThingsSmitty
AllThingsSmitty / accessible-menu.css
Last active Oct 17, 2019
Accessible dropdown menu
View accessible-menu.css
/* Top level nav */
.nav {
float: left;
margin: 20px 0;
}
/* Dropdowns */
.nav ul {
position: absolute;
top: 2.5em;
@AllThingsSmitty
AllThingsSmitty / js-terms.md
Last active Sep 30, 2019
10 terms to help you better understand JavaScript
View js-terms.md

10 JavaScript Terms You Should Know

From currying to closures there are quite a number of special words used in JavaScript. These will not only help you increase your vocabulary but also better understand JavaScript. Special terms are normally found in documentation and technical articles. But some of them like closures are pretty standard things to know about. Knowing what the word itself means can help you know the concept it's named for better.

  1. Arity
  2. Anonymous
  3. Closure
  4. Currying
  5. Hoisting
  6. Mutation
@AllThingsSmitty
AllThingsSmitty / apple-mq.css
Last active Sep 5, 2019
iPhone 6/6 Plus and Apple Watch CSS media queries
View apple-mq.css
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@AllThingsSmitty
AllThingsSmitty / flexslider.htm
Created Feb 1, 2015
Lazy loading images for FlexSlider
View flexslider.htm
<section class="slider">
<div class="flexslider">
<ul class="slides">
<li><img src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
<li><img class="lazy" data-src="http://imgur.com/..." alt=""></li>
</ul>
</div>
@AllThingsSmitty
AllThingsSmitty / width.css
Created Apr 6, 2015
Calculating grid column widths
View width.css
/*
First: determine the number of columns, ex.: 12
Second: determine the width of a single (1/12) column using the following formula:
scw = (100 – (m * (mc – 1))) / mc
Where:
scw = single column width
m = margin (1.6%)
mc = maximum columns (12)
Ex.: scw = 6.86666666667%
Lastly: use the scw to calculate the rest of the column widths using the following formula:
You can’t perform that action at this time.