On Projectors: http://talarian.blogspot.com/p/unity-tutorial.html
- Huge resources list: http://www.procedural-worlds.com/blog/best-free-unity-assets-categorised-mega-list/
// Adding this event listener prints the message | |
// into browser's console whenever the window | |
// is resized (emits the "resize" event). | |
// | |
// Note that the "resize" event occurs for each | |
// pixel that the browser being resized. | |
window.addEventListener('resize', function () { | |
console.log('Resize happened!') | |
}) |
function throttle(func, timeout) { | |
let wait = false; | |
return function (...args) { | |
if (!wait) { | |
func(...args) | |
wait = true; | |
setTimeout(function () { | |
wait = false; |
import React from 'react' | |
import { Box, useElementQuery } from 'atomic-layout' | |
// Initially, I thought of EQ as a standalone query-value binding | |
// with the React component being an application surface. | |
// The problem with this is that the props assignment becomes abstracted, | |
// and it's not easy to scan which props are assigned to a component, | |
// and which comes from the EQ declared eslewhere. | |
const InitialIdea = () => { | |
const styles = useElementQuery( |
const express = require('express'); | |
const app = express(); | |
// Application | |
app.get('/', function(req, res) { | |
if (process.env.NODE_ENV === 'development') { | |
for (var key in require.cache) { | |
delete require.cache[key]; | |
} | |
} |
export const VendorMachine = ({ | |
ballRadius, | |
gravity, | |
density, | |
drag, | |
onButtonClick, | |
}) => { | |
const canvasRef = React.useRef() | |
const { intersection, setIntersectionRef } = useIntersection({ | |
threshold: 0.5, |
On Projectors: http://talarian.blogspot.com/p/unity-tutorial.html
!(A && B) // is equivalent to | |
!A || !B | |
!(A || B) // is equivalent to | |
!A && !B |
Redux is a state management library. It implements a Flux pattern of handling the data and its primary feature is the reducing of the previous state to produce the next state.
Flux is an architecture pattern to handle data fetching. It splits data fetching into separate layers, making them predictable, but also embeds a "model" and "controller" parts of traditional MVC into modern applications.
.tooltip { | |
position: absolute; | |
top: 100%; | |
left: 0; | |
width: 100%; | |
max-width: 350px; | |
padding: 0.5rem 1rem; | |
background-color: #fff; | |
border: 1px solid #000; | |
border-radius: 4px; |
import React from 'react' | |
import { useFetch } from './hooks/useFetch' | |
const Example = () => { | |
const { data, loading, error } = useFetch('https://api.github.com/user/octocat') | |
if (loading) { | |
return <Spinner /> | |
} | |