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
atom-text-editor.editor { | |
font-family: "Fira Code"; | |
text-rendering: optimizeLegibility; | |
font-weight: 400; | |
line-height: 1.8; | |
.syntax--comment, | |
.syntax--entity.syntax--other.syntax--attribute-name { | |
font-family: "Operator Ssm"; | |
font-style: italic; |
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
#!/bin/bash | |
protected_branch='master' | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [ $protected_branch = $current_branch ] | |
then | |
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty | |
echo | |
if echo $REPLY | grep -E '^[Yy]$' > /dev/null |
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
// Generate a number | |
function generateNumber() { | |
return Math.floor(Math.random() * tipsList.length); | |
} |
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
function generateTip() { | |
var tip = tipsList[generateNumber()]; | |
} |
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
function generateTip() { | |
var tip = tipsList[generateNumber()]; | |
var tipElement = document.querySelector('.js-tip'); | |
tipElement.innerHTML = tip; | |
} |
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
// Tip Limit counter | |
var tipLimit = 3; | |
// Generate a number | |
function generateNumber() { | |
... | |
} | |
// Generate a tip: | |
// 1. Get random number from generateNumber() |
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
function onTipButtonClick() { | |
var tipButton = document.querySelector('.tip-button'); | |
tipButton.addEventListener('click', function() { | |
console.log('RIP clippy'); | |
}); | |
} | |
onTipButtonClick(); |
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
function onTipButtonClick() { | |
var tipButton = document.querySelector('.tip-button'); | |
tipButton.addEventListener('click', function() { | |
tipLimit = tipLimit - 1; | |
if (tipLimit >= 0) { | |
generateTip(); | |
if (tipLimit === 0) { | |
tipButton.innerHTML = 'See you in another tab!'; | |
tipButton.classList.add('disabled'); |
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 of JavaScript tips | |
var tipsList = [ | |
"Don't forget the <span class='code'>var</span> keyword when assigning a variable's value for the first time.", | |
"<span class='code'>undefined</span>, <span class='code'>null</span>, <span class='code'>0</span>, <span class='code'>false</span>, <span class='code'>NaN</span>, and <span class='code'>''</span> (empty string) are all falsy.", | |
"Declare a function with<br/> <span class='code-block'>function <em>myFunctionName</em>() { <br> ...<br> }</span>", | |
"<span class='code'>if</span>/<span class='code'>else</span> statements look like <br/> <span class='code-block'>if (<em>condition</em>) { <br/> ...<br/>} else { <br/> ...<br/>}", |
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
cd ~/ | |
mkdir .localhost-ssl | |
sudo openssl genrsa -out ~/.localhost-ssl/localhost.key 2048 | |
sudo openssl req -new -x509 -key ~/.localhost-ssl/localhost.key -out ~/.localhost-ssl/localhost.crt -days 3650 -subj /CN=localhost | |
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.localhost-ssl/localhost.crt | |
npm install -g http-server | |
echo " | |
function https-server() { |
OlderNewer