Skip to content

Instantly share code, notes, and snippets.

@jdaly13
jdaly13 / index.tsx
Last active November 3, 2022 03:51
switch out protocols
import { useState, useCallback, useRef, useEffect } from "react";
import { useSubmit } from "@remix-run/react";
import { Select } from "~/components/SelectMenu";
import { LogoIcon } from "~/components/LogoIcon";
import type { Chain } from "~/types";
import { getChainClient } from "~/chain-clients";
const options = [
{ name: "-- Select Value Below --", value: "" },
@jdaly13
jdaly13 / gist:a53ebed99926dfd5bb4bfe0aaeb77a16
Last active September 19, 2022 19:43
question-generation
import { useLoaderData } from "@remix-run/react";
import type { SetStateAction, Dispatch } from "react";
import React from "react";
import WalletProvider from "~/components/WalletProvider";
import Wrapper from "~/components/Wrapper";
import ConnectWalletButton from "~/components/ConnectWalletButton";
import CreateQuestionContainer from "~/components/CreateQuestionContainer";
import { getContracts } from "~/services/contracts.server";
@jdaly13
jdaly13 / gist:8d9c2ad85c3e46ed0618998f8abad37f
Last active July 25, 2022 20:14
QuestionStateController
//SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IQuestionStateController.sol";
import "./modifiers/OnlyAPI.sol";
contract QuestionStateController is IQuestionStateController, Ownable, OnlyApi {
mapping(uint256 => QuestionVote) public votes;
mapping(uint256 => STATE) public state;
@jdaly13
jdaly13 / drops-dropdowns.tsx
Created March 17, 2022 03:23
search params bounties
import React, { Fragment } from "react";
import { Menu, Transition } from "@headlessui/react";
import { ContentfulBounty } from "~/types";
import { ChevronDown16 } from "@carbon/icons-react";
import { capitalize, startCase, toLower } from "lodash";
import { getBountyStatus } from "~/utils/helpers";
const allLevels = "All Levels";
const allProjects = "All Projects";
const allDrops = "All Drops";
@jdaly13
jdaly13 / a.json
Last active January 7, 2022 16:44
discord server data
[
{
"id":"770287896669978684",
"name":"Remix",
"icon":"e1e3ff1c3519034de5b462ee06e3b6f9",
"owner":false,
"permissions":104189505,
"features":[
"ENABLED_DISCOVERABLE_BEFORE",
"SEVEN_DAY_THREAD_ARCHIVE",
@jdaly13
jdaly13 / listening to visibility state on each setInterval
Last active January 7, 2022 15:37
polling with pagelifecyle api
React.useEffect(() => {
const id = setInterval(() => {
if (document.visibilityState === 'visible') {
liveData.load("/drops");
}
}, 10000);
return () => clearInterval(id);
}, []);
@jdaly13
jdaly13 / genesis.json
Last active September 4, 2020 16:29
genesis sample
{
"config": {
"chainId": 8572054696,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
/*
Implements EIP20 token standard: https://github.com/ethereum/EIPs/issues/20
.*/
pragma solidity >=0.4.21 <0.7.0;
import "../installed_contracts/tokens/contracts/eip20/EIP20Interface.sol";
contract WWTtoken is EIP20Interface {
uint256 constant MAX_UINT256 = 2**256 - 1;
@jdaly13
jdaly13 / index.js
Created June 17, 2020 22:16
logging out errors
import assert from 'assert';
import uuid from 'uuid';
import btoa from 'btoa';
import _ from 'lodash';
import randomName from 'node-random-name';
import {request} from '@webex/http-core';
const BASE_PATH_SECURE = '/users/test_users_s';
const BASE_PATH = '/users/test_users';
@jdaly13
jdaly13 / campaign.js
Created April 28, 2020 20:38
react application for donating on ethereum blockchain part of ethereum-blockchain-developing-applications tutorial on pluralsight
import React, { Component } from 'react';
import { Button, Input, Table } from 'semantic-ui-react'
import { createContract } from './../ethereum/crowdfundingContract'
import { web3 } from './../ethereum/web3';
export class Campaign extends Component {
ONGOING_STATE = '0'
FAILED_STATE = '1'
SUCCEEDED_STATE = '2'