This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Have only your active Atom tab have a different style | |
* | |
* In Atom sometimes I open four panes... | |
* Top LR might correspond to an HTML template for a component, | |
* Bottom LR would correspond to similar style sheet for those components... | |
* and each pane might have multiple components. | |
* | |
* It can be helpful if Atom styles your active tab differently. | |
* Here's one way to do that: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// List all remotely tracked branches that do not exist in the remote repo | |
git remote prune origin --dry-run | |
// Prune all remotely tracked branches that do not exist in the remote repo | |
git remote prune origin | |
// List all local branches that were merged into master, explicitly exclude master from that list | |
git branch --merged master | grep -v 'master' | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO | |
// Add Promise.race example | |
// Add Promise.all example | |
// Refactor async simulations to better reflect real-world scenarios | |
// Refactor so that if the evenOrOdd async work is not wrapped in a Promise that it could cause unexpected behavior sometimes depending on JS Type/Reference errors | |
function getRandomData() { | |
return { | |
number: Math.floor(Math.random() * 10), | |
timeout: Math.floor(Math.random() * 10000) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// When migrating a site the siteurl and home url need to be adjusted | |
// Add these two update functions to functions.php... | |
// ..Load the site up... | |
// ..Verify that everything is working correctly.. | |
// ..Then remove these functions from functions.php | |
update_option( 'siteurl', 'http://localhost:8888' ); // Be sure Replace the parameter with the correct url | |
update_option( 'home', 'http://localhost:8888' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Taken from: http://stackoverflow.com/questions/588040/window-onload-vs-document-onload | |
According to Parsing HTML documents - The end, | |
The browser parses the HTML source and runs deferred scripts. | |
A DOMContentLoaded is dispatched at the document when all the HTML has been parsed and have run. The event bubbles to the window. | |
The browser loads resources (like images) that delay the load event. | |
A load event is dispatched at the window. | |
Therefore, the order of execution will be | |
DOMContentLoaded event listeners of window in the capture phase | |
DOMContentLoaded event listeners of document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These styles only affect IE 10 + 11 | |
@media all and | |
(-ms-high-contrast: none), | |
(-ms-high-contrast: active) { | |
.selector { | |
display: none; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.modal { | |
min-height: 100%; | |
position: fixed; | |
background-color: $darkslategray-opaque; | |
transform: translateY(-150%); | |
transition: transform 750ms ease-in-out; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dark text on light backgrounds | |
$md-dol-primary: rgba(0,0,0,.87); | |
$md-dol-secondary: rgba(0,0,0,.54); | |
$md-dol-hint: rgba(0,0,0,.38); | |
$md-dol-divider: rgba(0,0,0,.12); | |
// White text on dark backgrounds | |
$md-lod-primary: rgba(255,255,255,1); | |
$md-lod-secondary: rgba(255,255,255,.70); | |
$md-lod-hint: rgba(255,255,255,.50); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery 1.12+ | |
// Bind to window scrolling and setup debouncer | |
$(window).scroll(function() { | |
clearTimeout(this.id); | |
this.id = setTimeout(doneScrolling, 130); // 130ms was the shortest time that allowed execution of only once, any slower and it would fire multiple times | |
}); | |
// Execute any functions here when scrolling stops | |
// Put all the things here! | |
function doneScrolling(){ |