Skip to content

Instantly share code, notes, and snippets.

View yonifra's full-sized avatar
:octocat:
Hacking

Jonathan Fraimorice yonifra

:octocat:
Hacking
View GitHub Profile
@yonifra
yonifra / System Design.md
Created November 3, 2022 21:05 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@yonifra
yonifra / consoledebug.md
Last active June 27, 2022 12:27
Console Debugging

Console Debugging

These useful methods will allow you advanced console debugging while you interact with the editor. This is super useful in cases where you want to see the effects of certain operations on the DAL state (Thanks @Mervyn Kaplan!)

  • dsAdapter.logDalValueChangesForNamespaces
// log changes in these three namespaces
dsAdapter.logDalValueChangesForNamespaces(['DESKTOP', 'MOBILE', 'data'])
// log changes in all namespaces
@yonifra
yonifra / slots.md
Last active March 24, 2022 06:52
Slots Placeholders

Adds a placeholder

const addSlotsPlaceholder = destination => {
    const finalDestination = destination ? destination : documentServices.pages.getCurrentPage()
    const placeholderStructure = documentServices.components.buildDefaultComponentStructure('wixui.SlotsPlaceholder')
    return documentServices.components.add(finalDestination, placeholderStructure)
}
@yonifra
yonifra / refcompsWithSlots.js
Last active December 8, 2021 15:01
RefComps tests
it('should work', async () => {
const {ds} = await prepareTest()
const {viewerManager} = ds.adapter.host
const {ps} = ds.adapter
const REF_COMP_ID = 'refCompId'
const INFLATED_PLACEHOLDER_ID = `${REF_COMP_ID}_r_placeholderId`
const INFLATED_SLOTS_QUERY_ID = `${REF_COMP_ID}_r_placeholderId_slots-1`
const INFLATED_PLACEHOLDER_POINTER = {id: INFLATED_PLACEHOLDER_ID, type: 'DESKTOP'}
@yonifra
yonifra / config.json
Created December 7, 2021 09:00
Run jest tests VSC config
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "/Users/jonathanfr/.nvm/versions/node/v14.18.1/bin/node",
"args": [
"--runInBand",
@yonifra
yonifra / settings
Created December 7, 2021 08:59
VS Code Settings
{
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
@yonifra
yonifra / codeswing.json
Last active December 29, 2020 07:07
Testing
{
"scripts": [],
"styles": []
}
@yonifra
yonifra / mobileVariantPayload.js
Last active September 16, 2020 13:14
Payload
{
"actions": [
{
"id": "variants-kf5ecy56",
"namespace": "variants",
"op": "ADD",
"value": {
"id": "variants-kf5ecy56",
"metaData": {
"isHidden": false,
@yonifra
yonifra / React-Parent-Child-Component.js
Created January 16, 2019 19:39 — forked from yokesharun/React-Parent-Child-Component.js
A Simple Example of React Parent - Child Component
import React, { Component } from 'react';
Class ParentComponent extends Component{
constructor(props){
super(props);
this.state = {
title: "CodeFights",
description: "Online website"
}
}
@yonifra
yonifra / React-State-Props-Manipulation.js
Created January 16, 2019 19:39 — forked from yokesharun/React-State-Props-Manipulation.js
React State and props Initialisation and manupulation
// Define a state
this.state = {
name: "Jon Snow",
age: 28
}
// get value of the state
this.state.name