using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
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
<html> | |
<head> | |
<title>My first three.js app</title> | |
<style> | |
body { margin: 0; } | |
canvas { width: 100%; height: 100% } | |
</style> | |
</head> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/88/three.min.js"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.5.2/pixi.min.js"> | |
</script> | |
</head> | |
<body> |
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 React from 'react' | |
import mrEmitter from '../helpers/mrEmitter' | |
export default class EmittingComponent extends React.Component { | |
handleClick = () => { | |
mrEmitter.emit('onSomeEvent', 'foo sends bar') | |
} | |
render() { |
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g
. Once you're finished, you also won't need to use sudo
to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.
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
/* Check if it is april fools day */ | |
var aprilFools = { | |
month: 3, | |
date: 1 | |
} | |
function isItAprilFoolDay() { | |
var now = new Date(); | |
return (now.getMonth() == aprilFools.month && now.getDate() == aprilFools.date); | |
} |
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
//HTML | |
<!-- Refer to collective.js for loadscreen code. --> | |
<div id="overlay"> | |
<div id="progstat"></div> | |
<div id="progress"></div> | |
</div> | |
//CSS | |
//loading animation: | |
#overlay{ |
NewerOlder