Skip to content

Instantly share code, notes, and snippets.

View qalqi's full-sized avatar
🐢
I may be slow to respond.

Qalqi qalqi

🐢
I may be slow to respond.
  • Earth
View GitHub Profile
@cgcardona
cgcardona / multi-secp-tx.ts
Last active August 3, 2020 19:54
Example of creating a BaseTx using Avalanche.js with multiple Secp256k1 inputs and outputs of different assetIDs for the Avalanche network
// The setup
// AVAX Balance
// curl -X POST --data '{
// "jsonrpc":"2.0",
// "id" : 1,
// "method" :"avm.getBalance",
// "params" :{
// "address":"X-EKpEPX56YA1dsaHBsW8X5nGqNSwJ7JrWH",
// "assetID": "AVA"
// }
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { Image, StyleSheet, Dimensions } from 'react-native';
import FastImage from 'react-native-fast-image';
import ImageZoom from 'react-native-image-pan-zoom';
// ZoomableImage component renders a zoomable FastImage the size of the screen dimensions.
const dims = Dimensions.get('window');
@foloinfo
foloinfo / .js
Last active March 31, 2021 13:15
Workaround for uploading files from `assets-library` path on iOS with expo
// img
// {
// uri: '"assets-library://asset/asset.JPG?id=SOME_ID&ext=JPG"',
// md5: "some md5"
// }
// copy into cache dir first
const path = FileSystem.cacheDirectory + img.md5
await FileSystem.copyAsync({
from: img.uri,
@mweststrate
mweststrate / city.js
Last active August 7, 2019 11:05
City.js
import { decorate, observable, flow, onBecomeObserved, onBecomeUnobserved } from 'mobx'
import { log } from './log'
const APPID = '<secret>'
export class City {
location
temperature
interval
@alfredringstad
alfredringstad / README.md
Created September 25, 2017 13:26
Forking a single package in a monorepo

Forking a single package in a monorepo

The trend of using monorepos makes a lot of things easier to manage. However, when you want to fork a single package inside a monorepo, you'll have to chose one of two options:

  • Fork the entire monorepo (meaning you get all those extra boilerplate you don't really care about)
  • Manually copying the package files into a new git repo (meaning you'll loose all git history and have a lot of work to do when there's a new version of your base package)

The good news: There's a solution for this! And it's actually built in to git.

git subtree

One of the lesser-known (and vaguely documented) features of git is subtree. It's intended for this purpose, working as a great alternative to the criticized submodules. There are very few resources about using this in practice, so here's a guide for this specific use case.

@gregblass
gregblass / App.js
Last active September 21, 2019 17:30
Expo/React Navigation - Google Analytics Integration
import React, { Component } from 'react'
import { RootNavigator } from './navigators'
import { GoogleAnalyticsTracker } from './utils/analytics'
import { GA_TRACKING_ID } from './constants'
class App extends Component {
// gets the current screen from navigation state
getCurrentRouteName = (navigationState) => {
if (!navigationState) {
return null
@codediodeio
codediodeio / database.rules.json
Last active July 29, 2024 09:39
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@codediodeio
codediodeio / index.js
Last active January 23, 2021 17:06
Transactional Email Firebase Cloud Function with Sendgrid
var functions = require('firebase-functions');
const sendgrid = require('sendgrid')
const client = sendgrid("YOUR_SG_API_KEY")
function parseBody(body) {
var helper = sendgrid.mail;
var fromEmail = new helper.Email(body.from);
var toEmail = new helper.Email(body.to);
var subject = body.subject;
@ndbroadbent
ndbroadbent / rn-i18n-locale-identifiers.csv
Last active April 18, 2024 11:43 — forked from JaseHadd/ioslocaleidentifiers.csv
React Native i18n Locale Identifiers
Locale Identifier Description
af Afrikaans
af-NA Afrikaans (Namibia)
af-ZA Afrikaans (South Africa)
agq Aghem
agq-CM Aghem (Cameroon)
ak Akan
ak-GH Akan (Ghana)
am Amharic
am-ET Amharic (Ethiopia)
@parshap
parshap / node-modules-in-react-native.md
Last active November 15, 2023 11:15
Running Node Modules in React Native

Running Node Modules in React Native

How to use packages that depend on Node.js core modules in React Native.

See the [node-libs-react-native][node-libs-react-native] library as a convenience for implementing this method.

Node.js Core Modules