Skip to content

Instantly share code, notes, and snippets.

Avatar
undefined

David Narbutovich retyui

undefined
View GitHub Profile
View debug-github-actions.sh
#!/bin/bash
if [[ -z "$NGROK_TOKEN" ]]; then
echo "Please set 'NGROK_TOKEN'"
exit 2
fi
if [[ -z "$USER_PASS" ]]; then
echo "Please set 'USER_PASS' for user: $USER"
@retyui
retyui / react-native-branch.d.ts
Created Jan 10, 2020
react-native-branch Typescript definitions
View react-native-branch.d.ts
declare module 'react-native-branch' {
// https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution#content-schema
export type ContentSchema =
| 'COMMERCE_AUCTION'
| 'COMMERCE_BUSINESS'
| 'COMMERCE_OTHER'
| 'COMMERCE_PRODUCT'
| 'COMMERCE_RESTAURANT'
| 'COMMERCE_SERVICE'
| 'COMMERCE_TRAVEL_FLIGHT'
View globals.d.ts
/// <reference types="react" />
declare namespace FBT {
type $Values<T> = T[keyof T];
// https://github.com/facebookincubator/fbt/blob/e9c591f451dbfc91852e316869ae39ad41848c55/runtime/nonfb/GenderConst.js#L9-L23
interface GenderConst {
NOT_A_PERSON: 0;
FEMALE_SINGULAR: 1;
MALE_SINGULAR: 2;
@retyui
retyui / bable-fix.md
Last active Oct 9, 2019
Fix plugin-transform-typescript for fbt
View bable-fix.md

In file node_modules/@babel/plugin-transform-typescript/lib/index.js

For a function isImportTypeOnly add code:

  function isImportTypeOnly({
    binding,
    programPath,
    jsxPragma
  }) {
@retyui
retyui / fbt.sh
Created Oct 7, 2019
fbt bash utils
View fbt.sh
#!/bin/bash
BIN=./node_modules/babel-plugin-fbt/bin
TMP_ROOT=./.i18n-cache
SRC_ROOT=./src
SRC_MANIFEST=${TMP_ROOT}/src-manifest.json
ENUM_MANIFEST=${TMP_ROOT}/enum-manifest.json
SOURCE_STRINGS=${TMP_ROOT}/source-strings.json
@retyui
retyui / interceptors.js
Created Sep 16, 2019
Axios interceptors ordering
View interceptors.js
const axios = require('axios');
const a= axios.create()
a.interceptors.request.use(
(v) => (console.log('request 1 start'),v),
(v) => (console.log('request 1 end '),v)
)
@retyui
retyui / err.md
Last active Aug 3, 2019
FLOW.JS Report, 3 August 2019 (flow 0.95-0.104)
View err.md
@retyui
retyui / example.md
Last active Oct 27, 2020
HOW USE FLOW.JS WITH REDUX-SAGA
View example.md

These examples for:

Install or update typings

flow-typed install # for initial run
@retyui
retyui / delete.discord.messages.js
Last active Aug 23, 2019
Remove all discord messages
View delete.discord.messages.js
(async () => {
const ONE_OUR = 3.6e6;
const ONE_DAY = ONE_OUR * 24;
const ONE_WEEK = ONE_DAY * 7;
const ONE_MONTH = ONE_DAY * 30;
const MY_ACC = '450630799713370122';
const AUTH_HEADERS = {
authorization:
'NDUwNjMwNzk5NzEzMzcwMTIy.D1nm-A.-Y4FVlVUPvpa5iOhFPcV8wHezn4',
'x-fingerprint': '550955708544319502._NRVO3hY6wEg0MGkbkaV_blfirs',
@retyui
retyui / Install.md
Last active Aug 26, 2018
React Native auto deploy your application to Google Drive
View Install.md
yarn add fs-extra googleapis@33 mime-types shelljs

deploy.js

'use strict';

const { resolve } = require('path');