Skip to content

Instantly share code, notes, and snippets.

View zurgl's full-sized avatar
🪐
Working from home

zurgl zurgl

🪐
Working from home
  • YetAnotherSolution
  • France
View GitHub Profile

Migrate all Pathways to the new reducer

Description

The state of the application is managed by plain Javascript Object: we refer to it as the global state. It’s dedicated to:

  • Keep track of the completion of the pathways by the user.
  • Keep track of the state variable defined at the protocol level.
  • Store the defined metadata required by each protocol
  • Allow the UI to trigger the right event when needed.

foreword: A unique chapter on Arweave should be enough for a first draft

Arweave a backend for our publish plateform

Arweave Blockchain: Write Once, Store Forever.

  1. Is there aspecific tech for data? BlockWeave Primer
  2. How to defend against censorship? Make data immutable
  3. Hello World of Blockchain: Connect to the Block

Arweave Wallet: Unlock the Permaweb.

@zurgl
zurgl / test.js
Last active January 5, 2022 05:48
test solana service
// first install @solana "@solana/web3.js"
// yarn add @solana/web3.js
import {
Connection,
clusterApiUrl,
Keypair,
LAMPORTS_PER_SOL,
PublicKey,
} from '@solana/web3.js';
@zurgl
zurgl / polygon-hover.tsx
Created August 17, 2021 11:20
polygon-hover.tsx
import styled from "styled-components"
const primaryColor = "#966ae0"
const secondaryColor = "#F6F6F6"
const PolygonLogo = () =>
<PolygonSVG x="0px" y="0px" viewBox="0 0 38.4 33.5" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M29,10.2c-0.7-0.4-1.6-0.4-2.4,0L21,13.5l-3.8,2.1l-5.5,3.3c-0.7,0.4-1.6,0.4-2.4,0L5,16.3
c-0.7-0.4-1.2-1.2-1.2-2.1v-5c0-0.8,0.4-1.6,1.2-2.1l4.3-2.5c0.7-0.4,1.6-0.4,2.4,0L16,7.2c0.7,0.4,1.2,1.2,1.2,2.1v3.3l3.8-2.2V7
c0-0.8-0.4-1.6-1.2-2.1l-8-4.7c-0.7-0.4-1.6-0.4-2.4,0L1.2,5C0.4,5.4,0,6.2,0,7v9.4c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7
@zurgl
zurgl / friendly_explanation.md
Last active July 19, 2021 17:54
example of educational content

How would a DAO administrating the bridge work? I have to be honest, I'm a bit lost on this - as most web2 devs are, how would you explain in the simplest terms? as if i was the typical learner going through this curriculum

Younger, I remember my first solo road trip. When I've bought my first car, I thought I was definitly a freeman. Just put some gas in the tank, and any land trip was possible.

Once, far away I saw an amazing stuff: Normandy Bridge. "The perfect spot to take some selfies and boild up my socials networks" I thought. Unfortunatly at the entry, I've realized: this bridge is a tolled road for car, and I let my credit card at home.

@zurgl
zurgl / near-js.md
Created July 12, 2021 15:29
some near stuff
const { connect, keyStores } = require("near-api-js");
const path = require("path");
const homedir = require("os").homedir();
const nacl = require("tweetnacl");
const sha256 = require("js-sha256");

const ACCOUNT_ID = "near-example.testnet";
const CREDENTIALS_DIR = ".near-credentials";
@zurgl
zurgl / push_issue.md
Created July 6, 2021 00:36
git push issue

To push a cloned repo when two factor is enable

git remote -v
git remote remove origin
git remote add origin git@github.com:zurgl/example-helloworld.git 
git push --set-upstraem origin Update-to-keypair

to restore a file

@zurgl
zurgl / mint.js
Created July 3, 2021 01:19
solana js examples
const web3 = require('@solana/web3.js');
const splToken = require('@solana/spl-token');
(async () => {
//create connection to devnet
const connection = new web3.Connection(web3.clusterApiUrl("devnet"));
//generate keypair and airdrop 1000000000 Lamports (1 SOL)
const myKeypair = web3.Keypair.generate();
@zurgl
zurgl / async_tips.md
Last active June 9, 2021 03:17
async await tips

here

Standardize error handling

async function awesome() {
    try {
        const data = await promise;
        return [data, null]
    } catch(error) {
 console.error(error)
@zurgl
zurgl / hooks.md
Created June 8, 2021 09:49
Hooks snippets

here

useEffect( () => console.log("mount"), [] );
useEffect( () => console.log("will update data1"), [ data1 ] );
useEffect( () => console.log("will update any") );
useEffect( () => () => console.log("will update data1 or unmount"), [ data1 ] );
useEffect( () => () => console.log("unmount"), [] );