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
let myArr = [1, 2, 3]; | |
console.log(myArr); | |
// [1, 2, 3] | |
myArr.push(4); | |
console.log(myArr); | |
// [1, 2, 3, 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
let myArr = [1, 2, 3]; | |
console.log(...myArr); | |
// 1 2 3 | |
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
let arrOne = [1, 2, 3]; | |
let arrTwo = [...arrOne, 4]; | |
console.log(arrOne, arrTwo); | |
// [1, 2, 3] [1, 2, 3, 4] | |
let arrThree = [-1, 0, ...arrTwo]; | |
console.log(arrThree); | |
// [-1, 0, 1, 2, 3, 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
let objOne = {name: 'buck', height: 6}; | |
objOne.name = 'avery'; // object mutated | |
// non-mutation with assign method | |
// don't forget the empty object as the first parameter | |
let objTwo = Object.assign({}, objOne, {height: 4}); | |
console.log(objOne, objTwo); | |
// {name: "avery", height: 6} {name: "avery", height: 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
let objOne = {name: 'avery', height: 6}; | |
let objTwo = {...objOne, height: 4}; | |
console.log(objOne, objTwo); | |
// {name: "avery", height: 6} {name: "avery", height: 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
// ARROW GENERATOR | |
@mixin arrow( | |
$box-edge: top, | |
$arrow-size: 10px, | |
$border-width: 4px, | |
$background-color: white, | |
$border-color: black) { | |
position: relative; | |
background: $background-color; |
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> | |
<head> | |
<script src="https://rawgit.com/aframevr/aframe/b813db0614ac2b518e547105e810b5b6eccfe1c8/dist/aframe.min.js"></script> | |
</head> | |
<body> | |
<script> | |
AFRAME.registerComponent('set-sky', { | |
schema: {default: ''}, | |
init() { |
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
if (!process.env.token) { | |
process.exit(1); | |
} | |
const Botkit = require('botkit'); | |
const controller = Botkit.slackbot({ | |
debug: true, | |
}); |
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
hears(['play'], 'direct_message,direct_mention,mention', (bot, message) => { | |
const { user, channel, text } = message; // destructure message variable | |
const userData = text.match(/<@([A-Z0–9]{9})>/); // parse the text for user's 9 character id | |
if (userData) { | |
// if there is a user challenged, start the game | |
} else { | |
bot.reply(message, 'You didn\'t challenge anyone…'); | |
} | |
}); |
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
... | |
if (userData) { | |
const playerTwo = userData[1]; // player two's id is at the first index of match results | |
const gameData = { | |
id: channel, | |
players: { | |
[user]: { | |
accepted: true, | |
played: '', | |
}, |