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
// Credit: Tweet from @oliverjumpertz: https://twitter.com/oliverjumpertz/status/1460184236917460993 | |
// Filtering means: Test all elements of an array and take those with you that succeed the test | |
const filter = (array, callback) => array.reduce((accumulator, current, index, arr) => { | |
// This is the filter function. It decides which element is added to the new array | |
if (callback(current, index, arr)) { | |
// For each iteration, the current element is tested with the callback. If that test succeds | |
// it's added to the resulting array. | |
accumulator.push(current); | |
} |
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
<div id="app"> | |
<header> | |
<h1>Your cart</h1> | |
</header> | |
<main> | |
<div id="cart"> | |
<i class="fas fa-shopping-cart"></i> 2 items in cart | |
</div> | |
</main> | |
</div> |
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
1 | |
00:00:02,000 --> 00:00:08,000 | |
This is some text | |
2 | |
00:00:08,000 --> 00:00:10,000 | |
This is some more text | |
3 | |
00:00:10,000 --> 00:00:22,000 |
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 sayHi(){ | |
console.log("Hello!") | |
} |
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 fileSystem = require("fs"); | |
displayLongestAcceptableWord(); | |
function displayLongestAcceptableWord(){ | |
var longestAcceptableWords = getLongestAcceptableWords(); | |
longestAcceptableWords.forEach(function(word){ | |
console.log(word); | |
}); | |
} |
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
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import javax.imageio.ImageIO; | |
public class Pixelate | |
{ |
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
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import javax.imageio.ImageIO; | |
public class Pixelation | |
{ |
NewerOlder