Skip to content

Instantly share code, notes, and snippets.

View merlox's full-sized avatar
😄
Building great things together!

merlox merlox

😄
Building great things together!
View GitHub Profile
@merlox
merlox / test.js
Created February 24, 2022 23:51
This is the second test for the Solana Rust program
import { expect } from 'chai' // Keep this at the beginning of the file along with the other imports
it('Should write an article with 1 word successfully', async () => {
const deployerKeypair = anchor.web3.Keypair.generate()
const personThatPays = program.provider.wallet
// Add your test here
await program.rpc.initialize({
accounts: {
article: deployerKeypair.publicKey,
@merlox
merlox / lib.rs
Created February 23, 2022 17:17
The progress so far
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
#[program]
pub mod solana_global_article {
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> ProgramResult {
// Get the article
let article_account = &mut ctx.accounts.article;
@merlox
merlox / Cargo.toml
Created February 20, 2022 20:58
Cargo.toml
[package]
name = "solana-global-article"
version = "0.1.0"
description = "Created with Anchor"
edition = "2018"
[lib]
crate-type = ["cdylib", "lib"]
name = "solana_global_article"
@merlox
merlox / lib.rd
Created February 20, 2022 19:59
lib.rs
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
#[program]
pub mod solana_global_article {
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> ProgramResult {
Ok(())
}
pragma solidity 0.6.2;
pragma experimental ABIEncoderV2;
import 'https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol';
contract Insurance is usingProvable {
struct Policy {
uint256 id;
uint256 price;
string url;
{
"id": 1,
"description": "We are delighted You have chosen Us for Your insurance needs and are confident that You will be satisfied with the level of service and insurance protection You receive. In the following pages and the attached schedule, You willlearn everything You need to know about Your insurance Policy and how to contact Us in case You have a claim."
}
pragma solidity 0.6.2;
pragma experimental ABIEncoderV2;
import 'https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol';
contract Insurance is usingProvable {
struct Policy {
uint256 id;
uint256 price;
string url;
Steps to earn money by closing expired or under-collateralized loans.
1. Clone the repository https://github.com/merlox/cdl-loans-expirer by executing this command:
`git clone https://github.com/merlox/cdl-loans-expirer`
2. Install dependencies with `yarn install` or `npm install` note that you must have node.js installed https://nodejs.org/en/
3. Then create a file inside the project folder called `.secret` and paste your mnemonic phrase inside.
This will be used to give you the rewards to your address.
1. Learn to setup webpack.
2. Learn to create react files.
3. Setup package.json scripts.
4. Setup a server.js server.
5. Updating state, using effect and importing files.
To learn react:
@merlox
merlox / a.js
Created November 1, 2019 14:34
Mongoose: activesequences.insertOne({ status: 'active', recipientsReplied: [], currentSequence: 1, triggers: [ 1 ], _id: ObjectId("5dbc4212c258b00f44978640"), name: 'merunas', owner: ObjectId("5d9f2e642cbd71300c861254"), emails: [ { links: [], _id: ObjectId("5dbc4212c258b00f44978642"), subject: 'dsfgsd', content: '<html><head></head><body><p>gsdfg</p></body></html>', attachments: [], templateId: '5db962025c3fe60a199c3a8a' }, { links: [], _id: ObjectId("5dbc4212c258b00f44978641"), subject: 'ppp', content: '<div><p>ppp</p>\n' + '<p><a href="https://staging.palawan.io/stats/link-click?token=19489000598093750&amp;to=https://google.com/">https://google.com</a></p>\n' + '<p><a href="https://staging.palawan.io/stats/link-click?token=41436211247327544&amp;to=https://google.com/">https://google.com</a></p></div>', attachments: [], templateId: '5db85b9c4c0d641233f74b34' } ], recipients: { to: [ 'pwpwpwpw@gmail.com' ], cc: [], bcc: [] }, sequenceId: '5dbc3e90c258b00f44978636', threadId: '16e276217a012a09', createdAt: ne