Skip to content

Instantly share code, notes, and snippets.

View monapasan's full-sized avatar
💭
Earth Day is every day.

Oleg Yarin monapasan

💭
Earth Day is every day.
View GitHub Profile
import { ERC725 } from '@erc725/erc725.js';
import { Contract, toBeHex } from 'ethers';
import { ethers } from 'hardhat';
import { Environment } from '../types';
import { ENV_CONFIG } from '../constants';
import { INTERFACE_IDS } from '@lukso/lsp-smart-contracts/dist/constants.cjs.js';
import { keyManagerABI, universalProfileAbi } from '../../change-up-name/ABI';
import { schemaLSP12IssuedAssets } from '../../../src/modules/blockchain/blockchain.schemas';
{
"amount": 142,
"list": [
{
"id": 195,
"description": "Every K-Pop fan needs a special guardian to accompany them on their metaverse journey! Inspired by the first alien featured in the 1998 “Dreams Come True” music video by S.E.S and reimagined by aespa, each æ-pet is uniquely generated by AI algorithm., we now introduce you to the third generation... **ae-pets** \n\nEach ae-pet is uniquely generated just for you. Use them as your profile picture, play with their unique filter, and share your special powers online, these special friends are here to make your metaverse journey extra maegical (✿◠‿◠)",
"isSoldOut": false,
"name": "ae-pets",
"euroPriceInCents": 2500,
"designer": "aespa x PAPER x DMAT",
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.9;
import '@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol';
import {LSP7CappedSupply} from '@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol';
import {LSP7DigitalAssetCore} from '@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol';
struct RoyaltyInfo {
bytes4 interfaceId;
address recipient;
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.9;
import '@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol';
import {LSP7CappedSupply} from '@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol';
import {LSP7DigitalAssetCore} from '@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol';
struct RoyaltyInfo {
bytes4 interfaceId;
address recipient;
async function exportContexts(savedContexts) {
// Iterate through every user
for (let user in savedContexts) {
// Iterate through every context of that user
for (let i = 0; i < savedContexts[user].length; i++) {
let contextname = savedContexts[user][i];
// Generate a Cypher statement to return the username, the context name and the statement text
let statement =
"MATCH (u:User{name:'" +
user +
@monapasan
monapasan / debugOutput.txt
Created September 30, 2021 13:24
Debug output for the slow prisma request
ody-parser:json content-type "application/json" +0ms
body-parser:json content-encoding "identity" +1ms
body-parser:json read body +0ms
body-parser:json parse body +11ms
body-parser:json parse json +0ms
express:router urlencodedParser : /context +12ms
body-parser:urlencoded body already parsed +1ms
prisma:client Prisma Client call: +4s
prisma:client prisma.context.create({
prisma:client data: {
@monapasan
monapasan / slowrequest.json
Created September 30, 2021 13:16
Request example slow query Prima
{
"context": {
"name": "bigdaddymax",
"body": "Social Networks 28 (2006) 466–484\nA Graph-theoretic perspective on centrality\u0001\nStephen P. Borgatti a,∗, Martin G. Everett b,1\na Department of Organization Studies, Boston College, Chestnut Hill, MA 02467, USA b University of Westminster, 35 Marylebone Road London NW1 5LS, UK\nAbstract\nThe concept of centrality is often invoked in social network analysis, and diverse indices have been\nproposed to measure it. This paper develops a unified framework for the measurement of centrality. All\nmeasures of centrality assess a node’s involvement in the walk structure of a network. Measures vary along\nfour key dimensions: type of nodal involvement assessed, type of walk considered, property of walk assessed,\nand choice of summary measure. If we cross-classify measures by type of nodal involvement (radial versus\nmedial) and property of walk assessed (volume versus length), we obtain a four-fold polychotomization\nwith one cell empty which mir
import React, { ReactElement } from 'react';
import classNames from 'classnames';
import style from './style.scss';
type IconName = 'check' | 'chevron-down' | 'minus';
interface IconProps {
name: IconName;
size?: 'small' | 'medium' | 'large';
color?: 'negative-80' | 'neutral-50' | 'neutral-90' | 'neutral-150';

Power BI feature - reading from the input

Why?

  • User don’t have to understand the ui to use the tool
  • in most of the cases it’s easier to just type text
  • “Awesome” effect.
  • draw bar chars that would be hard to formulate with filter tool.

What?

Based on the user's natural language input show appropriate chart. The idea is stolen from Power BI (Business intelligence tool from Microsoft).

package list
case class Cons (val head:Int, val tail:IntList) extends IntList{
def isEmpty=false
def nth(index:Int):Int= index match{
case 0 => head
case i => tail.nth(i-1)
}