Skip to content

Instantly share code, notes, and snippets.

View retyui's full-sized avatar
undefined

Davyd NRB retyui

undefined
View GitHub Profile
@retyui
retyui / start-vpn.sh
Created August 10, 2023 16:10
AnyConnect linux connect vpn script
#!/usr/bin/expect
set USERNAME "<user>"
set PASSWORD [lindex $argv 0]
eval spawn /opt/cisco/anyconnect/bin/vpn connect vpn.mysite.com
expect "Connect Anyway" { send "y\r" }
expect "import the certificate" { send "n\r" }
@retyui
retyui / remove-all.md
Last active August 10, 2023 16:17
Simple way to remove all workflow runs in GitHub Actions:

Simple way to remove all workflow runs in Github Actions:

export user=NameOrOrgName
export repo=RepoName


gh api repos/$user/$repo/actions/runs --paginate -q '.workflow_runs[] | "\(.id)"'  | xargs -n1 -I % gh api repos/$user/$repo/actions/runs/% -X DELETE
#!/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 January 10, 2020 09:42
react-native-branch Typescript definitions
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'
@retyui
retyui / globals.d.ts
Created October 9, 2019 07:53
Typescript definition library for fbt (https://facebookincubator.github.io/fbt/)
/// <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 October 9, 2019 07:45
Fix plugin-transform-typescript for fbt

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 October 7, 2019 22:52
fbt bash utils
#!/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 September 16, 2019 07:31
Axios interceptors ordering
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 August 3, 2019 10:23
FLOW.JS Report, 3 August 2019 (flow 0.95-0.104)
@retyui
retyui / example.md
Last active October 27, 2020 08:07
HOW USE FLOW.JS WITH REDUX-SAGA