This file contains hidden or 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(){ | |
$(window).on('scroll', function(){ | |
console.log($(this).scrollTop()); | |
}); | |
}); |
This file contains hidden or 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
// Turn content editable | |
document.body.contentEditable=true | |
// Time function execution | |
console.time('myTime'); //Starts the timer with label - myTime | |
for(var i=0; i < 100000; i++){ | |
2+4+5; | |
} |
This file contains hidden or 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
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"> | |
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png"> | |
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png"> | |
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png"> | |
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png"> | |
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png"> | |
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png"> | |
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png"> | |
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png"> | |
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"> |
This file contains hidden or 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
//CSS | |
body { | |
scroll-behavior: smooth; | |
} | |
//JS | |
<nav> | |
<a href="#profile">Profile</a> | |
<a href="#writing">Writing</a> | |
<a href="#presentations">Presentations</a> |
This file contains hidden or 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
/** | |
* For modern browsers | |
* 1. The space content is one way to avoid an Opera bug when the | |
* contenteditable attribute is included anywhere else in the document. | |
* Otherwise it causes space to appear at the top and bottom of elements | |
* that are clearfixed. | |
* 2. The use of `table` rather than `block` is only necessary if using | |
* `:before` to contain the top-margins of child elements. | |
*/ | |
.cf:before, |
This file contains hidden or 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
.tooltip-toggle { | |
cursor: pointer; | |
position: relative; | |
//Tooltip text container - above element | |
//You can adjust the position to make the container appear below or beside the element | |
&::before { | |
background-color: #000; | |
border-radius: 5px; | |
color: #fff; |
This file contains hidden or 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
// Go through a sentence, wrap its characters with spans | |
function setUpCharacters() { | |
var $sentences = $('.sentence'); | |
// Run for each sentence | |
$sentences.each(function() { | |
var $sentence = $(this); | |
var newContent = ''; | |
// Go through all characters of the sentence |
This file contains hidden or 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
let filterHomogenous = a => a.filter(b => b.length > 0 && b.every(e => typeof e == typeof b[0])); | |
var filterHomogenous = function (a) { | |
return a.filter(function (b) { | |
if(b.length > 0) { | |
return b.every(function (e) { | |
return typeof e === typeof b[0]; | |
}); | |
} | |
}); |
This file contains hidden or 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
var divs = document.querySelectorAll('div'); | |
Array.prototype.forEach.call(divs, function (i) { | |
var elem = i; | |
console.log(elem.innerHTML); | |
}); |
This file contains hidden or 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
$base-line-height: 24px; | |
$white: rgb(255,255,255); | |
$off-white: rgba($white, 0.2); | |
$spin-duration: 1s; | |
$pulse-duration: 750ms; | |
@keyframes spin { | |
0% { | |
transform: rotate(0deg); | |
} |