Skip to content

Instantly share code, notes, and snippets.

(function () {
const items = [
'🍭',
'❌',
'⛄️',
'🦄',
'🍌',
'💩',
'👻',
'😻',
body {
width: 100vw;
height: 100vh;
margin: 0;
padding: 0;
}
#app {
width: 100%;
height: 100%;
<div id="app">
<div class="doors">
<div class="door">
<div class="boxes">
<!-- <div class="box">?</div> -->
</div>
</div>
<div class="door">
<div class="boxes">
@toschivictor
toschivictor / anagrams.js
Last active September 29, 2017 14:20
Two words are anagrams of each other if they both contain the same letters. Bellow is a function that will find all the anagrams of a word from a list.
const anagrams = (word, words) => {
const sortedWord = word.split('').sort().join('');
return words.filter(item =>
item.split('').sort().join('') === sortedWord
);
};
anagrams('abc', ['cba', 'bac', 'trk']);
function fizzBuzz(num) {
num = parseInt(num);
if (!(num % 3) && !(num % 5))
return 'FizzBuzz';
else if (!(num % 3))
return 'Fizz';
else if (!(num % 5))
return 'Buzz';
function fizzBuzz(num) {
num = parseInt(num);
if (!(num % 3) && !(num % 5))
return 'FizzBuzz';
else if (!(num % 3))
return 'Fizz';
else if (!(num % 5))
return 'Buzz';
window.addEventListener('message', event => {
let message = event.data;
});
// getting the window from an iframe
let targetWindow = iframe.contentWindow;
targetWindow.postMessage('Hello World!', 'http://example.com');
@toschivictor
toschivictor / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console