Skip to content

Instantly share code, notes, and snippets.

View 0xpatrickdev's full-sized avatar
🚀

0xPatrick 0xpatrickdev

🚀
View GitHub Profile
@0xpatrickdev
0xpatrickdev / react-native-calendars.js
Last active July 19, 2017 04:24
A node_modules file that uses ES.Next/ES7+ Property Initializers
import React, {Component} from 'react';
import {
View,
ViewPropTypes,
} from 'react-native';
import PropTypes from 'prop-types';
import XDate from 'xdate';
import dateutils from '../dateutils';
import {xdateToData, parseDate} from '../interface';
import fetch from 'isomorphic-fetch';
import stripeInit from 'stripe';
import {stripeKey, graphCoolEndpoint} from './constants';
const stripe = stripeInit(stripeKey);
const updateGraphCoolCustomer = async (id, stripeId) => {
const updateCustomer = JSON.stringify({
query: `
mutation {
@0xpatrickdev
0xpatrickdev / AppDelegate.m
Created December 6, 2018 01:55
Handle deep liking from multiple sources in a React Native app for iOS
// 'The AppDelegate.m file can only have one method for openUrl.'
// 'If you're also using RCTLinkingManager to handle deep links, you should handle both results in your openUrl method.'
// https://github.com/facebook/react-native-fbsdk#32-ios-project
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <CodePush/CodePush.h>
#import <react-native-branch/RNBranch.h>
@0xpatrickdev
0xpatrickdev / interest.js
Created June 21, 2023 17:26
interest math agoric
// @ts-check
import {
makeRatio,
multiplyBy,
multiplyRatios
} from '@agoric/zoe/src/contractSupport/ratio.js';
import '@agoric/ertp/src/types-ambient.js';
export const MS_IN_A_YEAR = 31_557_600_000n;
const BPS_IN_DECIMAL = 10_000n;
@0xpatrickdev
0xpatrickdev / stake-evenly.sh
Last active April 12, 2025 18:49
testnet delegate and unbond
#!/bin/bash
DELEGATOR_ADDRESS="agoric1...."
NODE="https://devnet.rpc.agoric.net:443"
CHAIN_ID="agoricdev-23"
DENOM="ubld"
FLAGS="--node $NODE --chain-id $CHAIN_ID --keyring-backend test -y -b block"
FAUCET_URL="https://devnet.faucet.agoric.net/go"
FAUCET_QTY=75000000
## set to 33.4%. consumers of this script may want to start with smaller amounts
@0xpatrickdev
0xpatrickdev / address.d.ts
Created April 24, 2024 23:30
attempt at a universal type for BlockchainAddress, with some mock data
enum ChainId {
Ethereum = 1,
Bitcoin = 0,
Cosmos = 'cosmoshub-4',
Injective = 'injective-1',
Evmos = 'evmos_9001-2',
Polkadot = 0,
Kusama = 2,
Moonbeam = 1284,
Polygon = 137,
@0xpatrickdev
0xpatrickdev / README.md
Last active April 12, 2025 18:48
bech32-combined-addresses

two-way

produces a long address, but derivation works both ways

go run ./two-way
Test Case 1:
LCA Address: agoric16kv2g7snfc4q24vg3pjdlnnqgngtjpwtetd2h689nz09lcklvh5s8u37ek
Receiver Address: osmo183dejcnmkka5dzcu9xw6mywq0p2m5peks28men
@0xpatrickdev
0xpatrickdev / make-vanity-addr.js
Created December 31, 2024 22:01
bech32 vanity addresses
#!/usr/bin/env node
/* eslint-disable no-underscore-dangle */
/* global setInterval clearInterval */
import { Command } from 'commander';
import { Worker } from 'worker_threads';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import process from 'process';
const __filename = fileURLToPath(import.meta.url);