Skip to content

Instantly share code, notes, and snippets.

View ngtrphuong's full-sized avatar

Phương Nguyễn ngtrphuong

  • HCM - Viet Nam
View GitHub Profile

Build a flutter app in WSL2

Install, build and debug a flutter app in WSL2 (Windows Subsystem for Linux).

Linux setup

Install Java

To install the JDK, execute the following command, which will also install the JRE:

sudo apt install default-jdk

Add the following two lines to /etc/profile (setting the JAVA_HOME environment variable):

Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# 1024x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 64.11 MHz
# Modeline "1024x768_60.00" 64.11 1024 1080 1184 1344 768 769 772 795 -HSync +Vsync
# 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz
# Modeline "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync
# 1368x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 85.86 MHz
# Modeline "1368x768_60.00" 85.86 1368 1440 1584 1800 768 769 772 795 -HSync +Vsync
@ngtrphuong
ngtrphuong / ABC.md
Created April 16, 2024 03:40 — forked from jdnichollsc/ABC.md
The Job Interview Guide

The Job Interview Guide 💼

And English is a Work in Progress ⌛

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@ngtrphuong
ngtrphuong / Carthage2Cocoapods.md
Created September 10, 2021 03:08 — forked from thesailordev/Carthage2Cocoapods.md
Convert a Carthage Dependency-Managed Project to Cocoapods

Carthage to Cocoapods

We recently had the need to align our frameworks to one dependency management system. Previously we were using Carthage and Cocoapods (or both) amongst different frameworks. The burden of supporting both platforms coupled with long build times on our CI/CD drew us away from Carthage. During this conversion I encountered several "gotcha" moments in our Xcode projects that I want to share with others who might be doing the same thing to get you to a clean Cocoapod based build.

Assumptions

  • You have a working knowledge of Carthage and Cocoapods
  • You have a working knowledge of Xcode project settings
@ngtrphuong
ngtrphuong / TestSwipe.robot
Created September 6, 2021 04:02 — forked from semutmerah/TestSwipe.robot
Demo Scroll Down / Scroll Up using Swipe keyword in Robot Framework
*** Settings ***
Library AppiumLibrary 15 run_on_failure=Log Source
Library Process
Suite Setup Spawn Appium Server
Suite Teardown Close Appium Server
Test Teardown Close Application
*** Variables ***
## Go here to download the apk for the app used in this test -> https://drive.google.com/file/d/19FxLjux8ZtumweXzBA_CYrL0Va-BL4gY/view?usp=sharing
@ngtrphuong
ngtrphuong / main.dart
Created August 24, 2021 10:32
DropDownSearch with border in popupitems display
import 'package:dio/dio.dart';
import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'user_model.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {