Skip to content

Instantly share code, notes, and snippets.

View jessgusclark's full-sized avatar

Jesse Clark jessgusclark

View GitHub Profile
@jessgusclark
jessgusclark / local.properties
Created January 18, 2024 14:09
Local Properties file for building in Android
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
storePassword=
sdk.dir=
keyAlias=
@jessgusclark
jessgusclark / ExampleComponent.tsx
Created October 27, 2022 11:44
React Native Example Component for User Services
import { React, ReactElement, useState } from 'react'
import { StyleSheet, View } from 'react-native'
import {selectSomeGlobalState} from './somefolder'
// Props described as an interface(always use on objects)
// type keyword is usually used to describe union types,
// navigation types.
interface Props {
// required props in the beginning
children: ReactElement
@jessgusclark
jessgusclark / SmartWalletFactory.sol
Last active November 9, 2021 15:48
Files to augment RIF Relay deployment
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/cryptography/ECDSA.sol";
import "../interfaces/ISmartWalletFactory.sol";
import "../utils/RSKAddrValidator.sol";
/* solhint-disable no-inline-assembly */
/* solhint-disable avoid-low-level-calls */
@jessgusclark
jessgusclark / wallet_watchAsset.js
Created April 22, 2021 10:43
Adding an ERC20 token to Metamask with wallet_watchAsset
const params = addToken({
type: 'ERC20',
options: {
address: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5',
symbol: 'RIF',
decimals: 18,
image: 'https://s2.coinmarketcap.com/static/img/coins/64x64/3701.png'
}
})
@jessgusclark
jessgusclark / wallet_addEthereumChain.js
Last active August 10, 2021 13:50
Metamask wallet_addEthereumChain and wallet_watchAsset
const addNetwork = () => {
const params = [{
chainId: '0x1e',
chainName: 'RSK Mainnet',
nativeCurrency: {
name: 'RSK BTC',
symbol: 'RBTC',
decimals: 18
},
rpcUrls: ['https://public-node.rsk.co'],
{
"vc": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiableCredential",
"VaccineRecord"
],
"credentialSubject": {
@jessgusclark
jessgusclark / decoded-shot-1.json
Created January 11, 2021 11:35
Decoded Credential
{
"vc": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiableCredential",
"VaccineRecord"
],
"credentialSubject": {
{"id": "ce9f6b5b30d6d4278e8975e46c5952ad7255e0f85b8b6014037c1c5389feb6a0b68ecee51e726a309ce87d54ee6874cde3bf55c2d4e48ff9bd46cb183615a271"}
@jessgusclark
jessgusclark / concat-address.js
Created April 10, 2020 11:53
Concat address
export const concatAddress = addr => `${addr.substr(0, 6)}...${addr.substr(addr.length - 4)}`;
@jessgusclark
jessgusclark / getConfig.js
Last active May 19, 2020 13:22
Get the contract addresses needed for the RNS Manager after running the RNS suite migration
// Procedrual script that gets the contract addresses from the build
// folder after migration. This file can be used inside of the RNS
// Manager React application to use the local RKS network.
// The code isn't pretty, but it works.
//
// TO RUN:
// Set the two variables below, and then in the console, run:
// node getConfig.js
//
// the output is a json script that can be copied and pasted into the