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
dataArray.reduce((a, b) => [...a, | |
...(b.data && b.data.isImportant && b.data.value ? [b.data.value] : []) | |
], []); | |
/** | |
* Thwe horrific JavaScript snippet above is equivalent to the following | |
*/ | |
dataArray | |
.filter((x) => x.data && x.data.isImportant && x.data.value) |
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
const arr = [/* The list of valid words */] | |
const regex = /(אמת|ג|דעם|ום|ז(י|ך|נ|ץ)?|טב|י(ז|ן|ץ)?|כ|ךק|ל|מ(חל|רצ)|נ(ז|ץ|ר)?|ן(ך|נ)?|פה|ף(ז|י|ך|נ|ץ)?|צק|ץ(ז|י)?|ק(י|ן|ף)?|ר|שס)+?/g; | |
function divideWord(word) { | |
let ans = ''; | |
let prefix = ''; | |
let match = regex.exec(word); | |
while (match !== null) { | |
ans += prefix + match[1]; |
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
"build-css": "node-sass-chokidar --include-path ./src src/ -o src/" | |
// turns into: | |
"build-css": "node-sass-chokidar --include-path ./src src/ -o src/ && node-sass-chokidar --include-path ./public/css public/css/ -o public/css/" |
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
import 'css/aboveTheFoldLandingPage.css'; | |
// Now only this file was blocking the rendering process | |
class LandingPage extends Component { | |
render() { | |
return <div className="landingPage"> | |
<div className="above"> | |
{/* I'm above the fold, | |
Therefore I need to load first. */} | |
</div> |
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
import 'css/wholeLandingPage.css'; | |
import 'css/bootstrap.min.css'; | |
class LandingPage extends Component { | |
render() { | |
return <div className="landingPage"> | |
<div className="above"> | |
{/* I'm above the fold, | |
Therefore I need to load first. */} | |
</div> |
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
.LC0: | |
.string "%d\n" | |
main: | |
push rbp | |
mov rbp, rsp | |
sub rsp, 16 | |
mov dword[rbp-4], 1 | |
jmp .L2 | |
.L3: | |
mov eax, dword[rbp-4] |
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
#include <stdio.h> | |
int main() { | |
char* words[3] = {"apple", "orange", "banana"}; | |
for(int i = 1; i < 4; i ++) { | |
printf("%d. %s\n", i, words[i - 1]); | |
} | |
return 0; | |
} |
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
public class JavaExample { | |
public static void main(String[] args) { | |
String[] words = {"apple", "orange", "banana"}; | |
for(int i = 1; i < 4; i ++) { | |
String toPrint = i + ". " + words[i - 1]; | |
System.out.println(toPrint); | |
} | |
} | |
} |
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
words = ["apple", "orange", "banana"] | |
for i in range (1,4): | |
to_print = str(i) + ". " + words[i - 1] | |
print(to_print) |