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 / 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

@hungdev
hungdev / charles.md
Last active January 7, 2025 14:03
charles
https://viblo.asia/p/charles-ung-dung-cong-cu-charles-vao-kiem-thu-Qbq5Q1A45D8

https://www.youtube.com/watch?v=AW2vTBRfOrU&fbclid=IwAR2Wx7y_z2lyctwwVPXa_szQe47A60qnjKTDnGE0yUGy7MFmzHCQzs_zx34


với các lần sau:
ở Iphone vào wifi => config proxy => manual => ip laptop port 8888 ( khi config cái này thì ở charles laptop nó sẽ hỏi allow )
general => about => certificate => enable charles CA
general => profile & device management => check xem đã có charles proxy CA chưa.
@hungdev
hungdev / Build release android react native.md
Last active April 18, 2022 13:58
Build release android react native

Go to android/app

run:

keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

add these lines to adroid/gradle.properties, password is keystore password you created when generate keystore