Quick example how to work with RxJS
as a Pipe of messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const keythereum = require('keythereum') | |
const keystore = require("path/to/keystore.json") | |
const password = "PASSWORD" | |
const privateKey: string = keythereum.recover( | |
password, | |
keystore | |
) |
Connect quickly to Alastria network and run SC functions
- Go to remix (Without https!)
- Go to "Deploy & run transactions" (third icon on the left bar)
- Select the "Web3 Provider" and use this node: http://63.33.206.111/rpc
- Go to the plugin manager (fourth icon) and add "DGIT"
- A new git icon on the left bar has appeared, click it
- Open Github tab and look for the clone
- Paste this repository: https://github.com/alastria/alastriaID-truffle-contracts (you can select the branch)
- If you go to File explorer you will find the contracts there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// More info at: | |
// https://www.perimeterx.com/tech-blog/2019/list-every-event-that-exists-in-the-browser/ | |
// Just run it in developer console: | |
function _isEvent(prop) { | |
if (0 !== prop.indexOf("on")) { | |
return false; | |
} | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- See https://play.tailwindcss.com/PGizn94M2s --> | |
<div class="min-h-screen bg-gray-50 py-6 flex flex-col justify-center relative overflow-hidden sm:py-12"> | |
<div class="absolute inset-0 bg-[url(/img/grid.svg)] bg-center [mask-image:linear-gradient(180deg,white,rgba(255,255,255,0))]"></div> | |
<div class="relative px-6 pt-10 pb-8 bg-white shadow-xl ring-1 ring-gray-900/5 sm:max-w-5xl sm:mx-auto sm:rounded-lg sm:px-10"> | |
<div class="max-w-4xl mx-auto"> | |
<div class="divide-y divide-gray-300/50"> | |
<div class="py-8 text-base leading-7 text-gray-600"> | |
<p> | |
An amazing Tooltip | |
<span class="group hover:underline cursor-pointer inline-block relative"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/a/15030117/8312883 | |
function flatten(arr) { | |
return arr.reduce(function (flat, toFlatten) { | |
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten); | |
}, []); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig, toEscapedSelector: e } from 'unocss' | |
// See it in action: | |
// https://unocss.antfu.me/?html=DwVwNgBAdgLgFgWgEwC4YFMAeMECMwjrTwIDMKuA5ngUZQE4CWAJhAywgMYD2YAzmQgAHMAENO6BIwwBbARNjp6ERH07106KACgIetqKEJMCACwA%2BXRGBhG5gJKyIARmAB6W5b027j9DIgkd08rHwcnUmC7bXdwcyA&config=JYWwDg9gTgLgBAbzgEwKYDNgDtUGEJaYDmANHDBAKIDOAxgIZirIDKqANqrRVAFxyo4AXzjooEEHADkAVywRa1alIBQK1AA9IsFBnoz28NJhz5CwIgAoEKuHCgHU1fgG1bduC4D0APSwwACwAdAFpLIOQAagBKIN5LADoAKmiAEi8yemoATyxaOEsXMmQyKABdMgQoegB3Nk5uaDJaAmoYB25cFhYyIlQcap4haLgAXgA%2BRDh3DzgWrDb7RzG4WvpgeEs%2BgfoeBLB6KGpUABUIAGt%2Byyho6JmPKFQYGSgsOAADVIRUa9r6rh40REkySvH8ARCtACwHYyEsX2QwymXwcnBcAAYyi4AExlERCd73IQVdxlFTDIA&options=N4IgzgLgTglgxhEAuaBXApgXyA | |
export default defineConfig({ | |
rules: [ | |
[/^nth\-(\d+)\:(.*)$/, async ([, d, r], {rawSelector, constructCSS, generator}) => { | |
const rule = await (generator.parseToken(r)) | |
return `${e(rawSelector)} > *:nth-child(${d}) { ${rule[0][2]} }` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8.0; | |
import "@uniswap/swap-router-contracts/contracts/interfaces/IV3SwapRouter.sol"; | |
import "./interfaces/IERC20Meta.sol"; | |
import "./interfaces/IWrappedChainToken.sol"; | |
import "./BaseCombinedGsnHandler.sol"; | |
abstract contract BaseERC20MetaHandler is BaseCombinedGsnHandler { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION public.get_establishment_by_uuid(uuid UUID) | |
RETURNS JSONB AS | |
$$ | |
DECLARE | |
result JSONB; | |
BEGIN | |
SELECT | |
json_build_object( | |
'uuid', e.uuid, | |
'name', e.name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import data from "./YOUR_JSON.json" assert { type: "json" }; | |
const apiEndpoint = 'https://{SUPABASE_REF}.supabase.co/rest/v1/rpc/upsert_location_with_gmaps_api'; | |
const apiKey = 'API_KEY'; | |
const authorizationBearer = 'YOU AUTH'; | |
const makeRequest = async (data: any[]) => { | |
const headers = new Headers(); | |
headers.append('Content-Type', 'application/json'); | |
headers.append('apikey', apiKey); | |
headers.append('Authorization', `Bearer ${authorizationBearer}`); |