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
| problem: when import and envoke a webRTC in a node.js app. that is only for a browser app. | |
| $ bun run --hot index.ts | |
| error: Cannot find module '../../../build/Release/node_datachannel.node' from '/private/tmp/x/node/node_modules/@ipshipyard/node-datachannel/dist/esm/lib/node-datachannel.mjs' | |
| solution: add following code segment to your project.json and build node_modules again | |
| + "trustedDependencies": [ | |
| + "@ipshipyard/node-datachannel", | |
| + ], |
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
| /dns6/14490944-bced-4f7a-90d0-5469826d6d01.pub.instances.scw.cloud/tcp/9001/wss/p2p/12D3KooW9scFmH8UkU39qG5WKWY5WW3MRTERUqLPCoqLQ1oAPpS4 |
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
| interface OllamaGenerateRequest { | |
| model: string; | |
| prompt: string; | |
| stream?: boolean; | |
| options?: Record<string, any>; // For Ollama-specific options | |
| } | |
| interface OllamaGenerateResponse { | |
| model: string; | |
| created_at: string; |
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: MIT | |
| pragma solidity ^0.8.20; | |
| import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | |
| import "@openzeppelin/contracts/interfaces/IERC1271.sol"; | |
| import "./IEntryPoint.sol"; | |
| // Simple Account Abstraction wallet with passkey-based signature verification | |
| contract AAWallet is IERC1271 { | |
| using ECDSA for bytes32; |
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 ipfsAPI = require("ipfs-http-client"); | |
| const chalk = require("chalk"); | |
| const { clearLine } = require("readline"); | |
| const { globSource } = ipfsAPI; | |
| const infura = { host: "ipfs.infura.io", port: "5001", protocol: "https" }; | |
| // run your own ipfs daemon: https://docs.ipfs.io/how-to/command-line-quick-start/#install-ipfs | |
| // const localhost = { host: "localhost", port: "5002", protocol: "http" }; |
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: MIT | |
| pragma solidity ^0.8.0; | |
| import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; | |
| contract CopyItem is ERC1155 { | |
| constructor() public ERC1155("http://mars.muzamint.com:3000/{id}.json") { | |
| // _mint(msg.sender, 0, 1000, "GOLD"); // owner, token id, amount, data | |
| // to use id for cryptokitty id as a copy of cryptokitty erc721 token | |
| } |
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
| // contracts/GameItems.sol | |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.6.0; | |
| import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; | |
| contract GameItems is ERC1155 { | |
| uint256 public constant GOLD = 0; | |
| uint256 public constant SILVER = 1; | |
| uint256 public constant THORS_HAMMER = 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
| /** | |
| *Submitted for verification at Etherscan.io on 2021-01-27 | |
| */ | |
| pragma solidity 0.6; | |
| contract Demo { | |
| event Echo(string message); | |
| function echo(string calldata message) external { |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" type="text/css" href="./style.less" /> | |
| </head> | |
| <body> | |
| <img src="./images/header.png" /> | |
| More content: <a href="./other.html">Link to another page</a>. | |
| <script type="module" src="./index.ts"></script> |
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
| 'use strict'; | |
| // Load modules | |
| const Boom = require('boom'); | |
| const Hoek = require('hoek'); | |
| const Joi = require('joi'); | |
| // Declare internals |
NewerOlder