Skip to content

Instantly share code, notes, and snippets.

View sandoche's full-sized avatar

Sandoche ADITTANE sandoche

View GitHub Profile
@sandoche
sandoche / CounterOnlyOnwer.sol
Created October 2, 2022 16:21
Example of a Counter with Owner access control in Solidity (for a blog post)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract Counter {
uint public count;
address owner;
// Modifier that makes sure the caller is the owner
modifier onlyOwner() {
require(msg.sender == owner);
@sandoche
sandoche / Counter.sol
Created October 2, 2022 15:59
Example of a Counter in Solidity (for a blog post)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract Counter {
uint public count;
// Function to get the current count
function get() public view returns (uint) {
return count;
}
@sandoche
sandoche / FUND3R - Technical guide.md
Created August 30, 2022 15:16
A temporary document to help you get started with FUND3R
@sandoche
sandoche / error.md
Created August 4, 2022 14:13
Issue with NEAR-SDK-JS - Cannot read properties of undefined (reading \'byteLength\')
> ava


  ✖ Add a hash to the notes of alice Rejected promise returned by test
  ─

  Add a hash to the notes of alice

 __tests__/index.ava.js:40
@sandoche
sandoche / errorLog.md
Created August 4, 2022 13:38
NEAR Workspace error
Excecuting wasi-stub...
node_modules/near-sdk-js/cli/deps/binaryen/wasi-stub/run.sh build/contract.wasm >/dev/null


> nearwrite-smartcontracts@0.1.0 test
> ava


  ✖ Add a hash to the notes of alice Rejected promise returned by test
@sandoche
sandoche / verifySignatureNear.js
Created June 15, 2022 09:02
An example of how to verify a message signature with Near api js
const nearApi = require("near-api-js");
const { sha256 } = require("js-sha256");
const run = async () => {
const keyPairA = nearApi.utils.key_pair.KeyPairEd25519.fromRandom();
const publicKeyAString = keyPairA.getPublicKey();
const keyPairB = nearApi.utils.key_pair.KeyPairEd25519.fromRandom();
const publicKeyA = nearApi.utils.key_pair.PublicKey.from(publicKeyAString);
@sandoche
sandoche / Live_Music_Coding.md
Last active July 2, 2022 19:28
Live Music Coding - Repositories with Stars count
@sandoche
sandoche / HOW_TO_INSTALL_FIREBASE_ANALYTICS_IN_GODOT.md
Created October 15, 2021 17:59
How to install firebase analytics in Godot

How to install firebase analytics in Godot

I wrote this guide about how to install firebase analytics in godot because I struggled and it may be useful for the future me and others.

1. Install NativeLib Addon

This guide explains how to install the nativelib Addon: https://drmoriarty.github.io/nativelib/guide/gui-usage.html#installation

In short:

  1. In the top bar of Godot click on AssetLib next to 2D, 3D, Script
  2. Look for NativeLib and install it
@sandoche
sandoche / gist:c7b5ca70503d2e396923ed082bc98906
Created August 25, 2021 12:04
Notion API - Creating page with image
curl 'https://api.notion.com/v1/pages' \
-H 'Authorization: Bearer '"SECRET_HERE"'' \
-H "Content-Type: application/json" \
-H "Notion-Version: 2021-05-13" \
--data '{
"parent": {
"type": "page_id",
"page_id": "PAGE_ID_HERE"
},
"properties": {
@sandoche
sandoche / BlastBulkMessenging.js
Last active May 20, 2020 15:28
How to send mass messages?
// How to build an website/app to send personalized messages with any instant messaging app
// 1. Start a project
// 2. Design your project using the deep link of your favorite instant messaging app (and using variables to push the right message to the right number)
// 3. Code your project
// 4. Build it
// 5. Test it
// 6. Distribute it
// 7. Bonus: Leave it open source in case they try to shut it down, at least someone will have a fork somewhere