Skip to content

Instantly share code, notes, and snippets.

View hungdev's full-sized avatar
💭
I may be slow to respond.

Hung Vu hungdev

💭
I may be slow to respond.
View GitHub Profile
@hungdev
hungdev / show menu dev react native.md
Created September 27, 2021 16:30
show menu dev react native

CMD + Ctrl + Z -> Show Inspector

@hungdev
hungdev / Keys For Visual Studio Code.md
Created September 27, 2021 16:27 — forked from ZainaliSyed/Keys For Visual Studio Code.md
`Shortcuts & Command` for `React-Native `

React-Native Command

Windows Commands

  • rm node_modules/
  • use ; for muti line commands
  • rm $TMPDIR/react-* ; rm ios/build ; rm node_modules ; yarn cache clean ; npm cache verify

React Native

  • react-native --help
@hungdev
hungdev / react native s3 upload.md
Created September 11, 2021 16:43
react native s3 upload
import { Platform, StyleSheet } from 'react-native';
import fs from 'react-native-fs';
import { decode } from 'base64-arraybuffer';
import AWS from 'aws-sdk';
import 'react-native-get-random-values'
import { customAlphabet } from 'nanoid'

const nanoid = customAlphabet('1234567890abcdef', 10)
@hungdev
hungdev / axiosInterceptor.js
Created August 17, 2021 11:46 — forked from nzvtrk/axiosInterceptor.js
Axios create/recreate cookie session in node.js enviroment
/* Basic example of saving cookie using axios in node.js and session's recreation after expiration.
* We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js
* Also, this example supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });
@hungdev
hungdev / resize resolution for ubuntu vitualbox.md
Last active October 12, 2021 02:59
resize resolution and allow copy for ubuntu vitualbox
sudo apt-get install virtualbox-guest-dkms

copy and páte:

vitualbox => setting of os => general => advanced tab => select 2 Bidirectional 

in tool bar ubuntu => devices => insert guest addition cd image... 
in side tool bar of ubuntu, it has cd ( vbox gas ), open it => right top corner => run software => open cmd type: reboot =>done
@hungdev
hungdev / Build and Publish app to testflight.md
Last active June 8, 2021 06:32
Build and Publish app to testflight
For IOS:

create bundle id at the page: http://developer.apple.com/ => Identifier
create New app in https://appstoreconnect.apple.com/apps

run command: expo build:ios

Fill in apple account info, choose build mode to ipa, don't choose expo auto generate mode because it will generate different bundle id
When the build is done, it will be pushed to the expo page (the expo account is logged in at the terminal console).
@hungdev
hungdev / Get param from url js.md
Created May 12, 2021 04:10
Get param from url js
const url = 'https://test/com?x=a&y=b#old&p=8397543#dsf43';
function getUrlVars(url) {
    var vars = {};
    var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
        vars[key] = value;
    });
    return vars;
}
console.log(getUrlVars(url)['x']) // a
@hungdev
hungdev / debound hook.md
Created April 16, 2021 06:51
debound hook
import React, { useState, useCallback } from "react";
import "./styles.css";
import { debounce } from "lodash";


export default function App() {
  const [userQuery, setUserQuery] = useState("");
  const sendQuery = query => console.log(`Querying for ${query}`);
 const delayedQuery = useCallback(debounce(q => sendQuery(q), 500), []);
@hungdev
hungdev / CloudFlare WARP macos.md
Created April 11, 2021 15:31
CloudFlare WARP macos

Step 1: Download warpplus.conf file.

Step 2: Download and Install WireGuard for MacOS.

Step 3: Open WireGuard and click "Import Tunnel (s) from file" button.

Step 4: Select "warpplus.conf" file and click "Active" button

this is file