float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
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 webpack = require('webpack'); | |
const path = require('path'); | |
module.exports = { | |
entry: './src/main.js', | |
output: { | |
path: path.resolve(__dirname, './build'), | |
filename: 'bundle.js', | |
}, | |
module: { |
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
/* | |
* Using the library ramda, what is the result of the following code? | |
* R.reduce((acc,x) => R.compose(R.flip(R.prepend)(acc), R.sum,R.map(R.add(1)))([x,...acc]), [0])([13, 28]); | |
* Explain each of the steps the best you can. | |
*/ | |
const R = require('ramda'); | |
// Reduce function iterating over [13, 28] | |
// starting point: [0] | |
const test = R.reduce( |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
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 text = text.replace(/\s(?=[^\s]*$)/g, ' '); |
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 avengers = ['Thor', 'The Hulk', 'Captain America']; | |
let guardians = ['Star Lord', 'Gamorra', 'Drax', 'Rocket', 'Groot']; | |
// Spread out arrays in a new array and put a new value in between them | |
const heroes = [...avengers, 'Loki', ...guardians]; | |
// Adding new stuff to an array just got easier too | |
guardians = [...guardians, 'Mantis', 'Yondu', 'Nebula']; | |
// Or simply making a TRUE copy of an array | |
const avengersCopy = [...avengers]; |
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 users = [ | |
{ | |
"_id": "5a0b7a6441a687091332f11b", | |
"index": 0, | |
"guid": "0d3bba05-ecde-4237-b53e-0bd474239ee2", | |
"isActive": false, | |
"balance": "$2,144.22", | |
"picture": "http://placehold.it/32x32", | |
"age": 32, | |
"eyeColor": "green", |
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 team = Array.of('Black Panther', 'Wolverine', 'X-23', 'Sabertooth'); | |
console.log(team); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Array .from()</title> | |
</head> | |
<body> | |
<ul class="heroes"> | |
<li>Hulk</li> | |
<li>Thor</li> |
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
// https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Statements/for...in | |
const hulk = { | |
color: 'Green', | |
size: 'Large', | |
weight: 500, | |
power: 'Super Strength', | |
}; | |
for (const prop in hulk) { | |
console.log(`${prop}: ${hulk[prop]}`); |
NewerOlder