Skip to content

Instantly share code, notes, and snippets.

View quangnd's full-sized avatar
💭
Obsidian hooker :")

Nguyen Dang Quang quangnd

💭
Obsidian hooker :")
View GitHub Profile
@quangnd
quangnd / Find the second largest number in array
Last active April 29, 2019 12:04
Find the second largest number in array
Write a function named getSecondLargest. This function has one parameter: an array of numbers. The function must find and return the second largest number in.
Sample input
`
nums = [2,3,6,6,5]
getSecondLargest(nums)
`
Sample output
@quangnd
quangnd / curl.md
Created October 16, 2018 07:37 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@quangnd
quangnd / gist:1cba6f8d2aff72231fec9bc7bf7fdcdd
Last active August 10, 2018 03:46
How to install the latest angular-cli?
You can run these two snippets to upgrade from angular-cli to the new package @angular/cli.
```
npm uninstall -g angular-cli
npm cache clean
npm install -g @angular/cli@latest
```
```
rm -rf node_modules dist
npm uninstall --save-dev angular-cli

Install suggested plugin

  • Folders Plugin
  • OWASP Markup Formatter Plugin
  • build timeout plugin
  • Credentials Binding Plugin
  • Timestamper Workspace Cleanup Plugin
  • Ant Plugin Gradle Plugin
  • Pipeline GitHub Organization
  • Folder Plugin
# Centos 7.3 comes with 1.8.3
# so update git from centos repo
yum update git
# it shows nothing to update
# we download git source and build and install latest git on Centos 7.3
@quangnd
quangnd / youtube-dl-download-pluralsight-videos.md
Created March 31, 2018 03:57 — forked from ivanskodje/youtube-dl-download-pluralsight-videos.md
youtube-dl for downloading pluralsight videos

Downloading Videos from Pluralsight

Disclaimer

Pluralsight do not permit users to download their videos.
If you are an user of pluralsight you have agreed with their ToS,
and are thusly refrained from doing so.
Use this knowledge at your own risk.

youtube-dl for Windows

@quangnd
quangnd / commit-msg
Created March 27, 2018 08:15 — forked from jhartikainen/commit-msg
ESLint git commit hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.js$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
echo $files | xargs eslint
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@quangnd
quangnd / gist:539f5e2a7f63634c0b73b931414e4a5a
Created March 20, 2018 02:57
Upload file to Linux server
> To copy files between your computer and your instance you can use an FTP service like FileZilla or the command scp which stands for secure copy.
> To use scp with a key pair use the following command:
```
scp -i path/to/key file/to/copy user@ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com:path/to/file
```
> To use it without a key pair, just omit the flag -i and type in the password of the user when prompted.
@quangnd
quangnd / README.md
Created March 5, 2018 04:17 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

OP: @leonardofed founder @ plainflow.