Skip to content

Instantly share code, notes, and snippets.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// mock class using ERC20
contract ERC20Mock is ERC20 {
constructor(
string memory name,
string memory symbol,
import * as React from "react";
import {Component, View, Image, StyleSheet, Svg, Text } from "react-figma";
import nozzleIcon from "../../pictures/icons/nozzle.svg";
import bottomPanelBackground from "./bottom-panel-background.svg";
import moneyIcon from "../../pictures/icons/Money.svg";
import ratingIcon from "../../pictures/icons/Rating.svg";
import clockIcon from "../../pictures/icons/Clock.svg";
import {Material} from "../material/Material";
const styles = StyleSheet.create({
import * as React from 'react';
import * as renderers from "./renderers"
export const renderer = async (jsx: React.ReactElement<any>) => {
if (typeof jsx.type === "function") {
const result = jsx.type(jsx.props);
await renderer(result);
} else if (renderers[jsx.type]) {
await renderers[jsx.type](jsx.props);
}
13:51:35.891 Cloning gitlab.com/timothy.kovalev/white-dacha (Branch: dev, Commit: 50dbdc9)
13:51:37.608 Cloning completed in 1717ms
13:51:37.610 Analyzing source code...
13:51:37.611 Warning: Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
13:51:38.310 Installing build runtime...
13:51:38.734 Build runtime installed: 423.753ms
13:51:39.141 Looking up build cache...
13:51:39.176 Build cache not found
13:51:39.593 Installing dependencies...
13:51:39.823 yarn install v1.22.4
import React from "react";
const LoadingWrapper = (props) => {
const {as, loading, ...otherProps} = props;
const el = React.useRef();
React.useEffect(() => {
el.current && el.current.setAttribute("loading", loading);
}, [loading]);
const Component = as;
@ilyalesik
ilyalesik / index.ts
Created February 20, 2020 19:12
Multiple effects at react-figma
import * as React from 'react';
import { Page, Rectangle } from 'react-figma';
export const App = () => {
const effects: Effect[] = [
{
type: 'DROP_SHADOW',
color: {
r: 0,
g: 0,
@ilyalesik
ilyalesik / logo.txt
Last active January 29, 2020 16:22
Tver.io Logo
████████████████████████████████████████████████████████████████████████████████
████████████████████████████████████████████████████████████████████████████████
███ ███
███ ███
███ ███
███ ███
███ ███
███ ███
███ ███
███ ███
@ilyalesik
ilyalesik / effector.js
Last active December 19, 2019 09:00
Storeon vs Effector
import {createStore, createEvent} from 'effector'
const inc = createEvent();
const countStore = createStore(0);
countStore.on(inc, (store, count) => store + count);
import {useStore} from 'effector/react'
export default const Counter = () => {
@ilyalesik
ilyalesik / text.js
Created December 5, 2019 10:38
Figma samples
// Creating text with zero width and wrapping any symbols to the next line
const textNode = figma.createText();
textNode.textAutoResize = 'HEIGHT';
textNode.characters = "some text";