Skip to content

Instantly share code, notes, and snippets.

View prevwong's full-sized avatar
🤒
be right back

Prev Wong prevwong

🤒
be right back
View GitHub Profile
@prevwong
prevwong / example-grid-craft.js
Created January 4, 2020 18:54
A simple Grid layout system with Craft.js
// Get total `width` of all children
const getAccumulatedChildrenWidth = (helper, parentId) => {
return helper(self.id).decendants().map(id => helper(id).get())
.reduce((a, b) => a.data.props.width + b.data.props.width, 0);
}
const Grid = () => {
return (
<div>
{children}
@prevwong
prevwong / 📊 Weekly development breakdown
Last active August 6, 2024 09:26
Weekly Coding Breakdown
Zig 21 hrs 43 mins ███████████████░░░░░░ 72.0%
TypeScript 6 hrs 6 mins ████▎░░░░░░░░░░░░░░░░ 20.3%
Java 2 hrs 1 min █▍░░░░░░░░░░░░░░░░░░░ 6.7%
Other 9 mins ░░░░░░░░░░░░░░░░░░░░░ 0.5%
JSON 4 mins ░░░░░░░░░░░░░░░░░░░░░ 0.2%
@prevwong
prevwong / craft-cypress.js
Last active February 13, 2021 16:26
Craft-Cypress Commands
class DummyDataTransfer {
data = {};
dropEffect = 'move';
effectAllowed = 'all';
files = [];
items = [];
types = [];