Skip to content

Instantly share code, notes, and snippets.

View prevwong's full-sized avatar
🤟
I may be slow to respond

Prev Wong prevwong

🤟
I may be slow to respond
View GitHub Profile
@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 = [];
@prevwong
prevwong / 📊 Weekly development breakdown
Last active March 4, 2024 17:09
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 / 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}