Skip to content

Instantly share code, notes, and snippets.

@tolmekian1453
tolmekian1453 / sig.js
Last active March 29, 2023 18:52
Verify a Tezos signature given a wallet address, public key, payload, and signature.
// Based on https://github.com/ecadlabs/taquito/blob/master/packages/taquito-remote-signer/src/taquito-remote-signer.ts#L155
const {
b58cdecode,
b58cencode,
buf2hex,
hex2buf,
isValidPrefix,
mergebuf,
prefix,
@tolmekian1453
tolmekian1453 / FirebaseAuthSync.m
Last active August 17, 2019 20:52
Firebase React Native Share Extension Credentials Syncer
// see https://github.com/firebase/firebase-ios-sdk/issues/2179
//
// this is a hack workaround that periodically copies the Firebase credentials
// between your main app and your share extension,
// thus allowing the extension to authenticate using the same creds
//
// make sure you've created an app group beforehand so they can share that storage
#import <Foundation/Foundation.h>
#import "FirebaseAuthSync.h"
@tolmekian1453
tolmekian1453 / react_native_circular_flex_image.js
Last active May 4, 2019 18:39
how to make a circular image in React Native with FlexBox (not fixed width/height). Note that this may not respond properly to changes such as device rotations; that's a todo.
class RoundImage extends React.Component {
state = { borderRadius: null }
// tactical hacks inbound
componentDidMount() {
setTimeout(function() { // for some reason, have to do this async for it to work
const image = this.refs.image
image.measure((a, b, width, height, px, py) => {
this.setState({borderRadius: width / 2})
})