Inspired of http://codepen.io/nenuadrian/details/iHoKq (not works for now) By the way this pen already inspired many other people :) And I have my first article about this - https://martijnbrekelmans.com/generative-art/heart-deconstruction/techniques.html Thank you!
const {useCallback, useEffect, useReducer, useRef} = require('react'); | |
let effectCapture = null; | |
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) { | |
let updateCounter = useRef(0); | |
let wrappedReducer = useCallback(function(oldWrappedState, action) { | |
effectCapture = []; | |
try { | |
let newState = reducer(oldWrappedState.state, action.action); |
import React, { useState, useEffect } from "react"; | |
import "./packages/combobox/styles.css"; | |
import { | |
Combobox, | |
ComboboxInput, | |
ComboboxList, | |
ComboboxOption, | |
ComboboxPopup | |
} from "./packages/combobox/index"; |
I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.
But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.
Svelte is a language.
Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?
A few projects that have answered this question:
Note:
When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.
If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:
- Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
class Disk { | |
constructor(capacity){ | |
this.capacity = capacity; | |
} | |
[Symbol.toPrimitive](hint){ | |
switch (hint) { | |
case 'string': | |
return 'Capacity: ' + this.capacity + ' bytes'; |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
UPDATE (Fall 2020): This gist is an updated version to the Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL) guide, I usually just keep here notes, configuration or short guides for personal use, it was nice to know it also helps other ppl, I hope this one too.
Windows updated windows subsystem for linux to version 2, as the F.A.Q stated you can still use WSL
version 1 side by side with version 2. I'm not sure about existing WSL
machines surviving the upgrade process, but as always backup and 🤞. NOTE: WSL
version 1 is not replace/deprecated, and there ar
Wave Function Collapse (WFC) by @exutumno is a new algorithm that can generate procedural patterns from a sample image. It's especially exciting for game designers, letting us draw our ideas instead of hand coding them. We'll take a look at the kinds of output WFC can produce and the meaning of the algorithm's parameters. Then we'll walk through setting up WFC in javascript and the Unity game engine.
The traditional approach to this sort of output is to hand code algorithms that generate features, and combine them to alter your game map. For example you could sprinkle some trees at random coordinates, draw roads with a brownian motion, and add rooms with a Binary Space Partition. This is powerful but time consuming, and your original vision can someti
/* ==UserStyle== | |
@name GitHub Dark | |
@homepageURL http://userstyles.org/styles/37035 | |
@updateURL https://userstyles.org/styles/37035.css | |
@md5URL https://update.userstyles.org/37035.md5 | |
@originalMD5 66643ceab5d8c458da6e0ead8f4133f3 | |
@author StylishThemes | |
@advanced color base-color "Base color scheme" #4183C4 | |
@advanced dropdown syntax-theme "Github syntax theme" { | |
Ambiance "Ambiance" <<<EOT |