Skip to content

Instantly share code, notes, and snippets.

View cptonypham's full-sized avatar
😇

Tony Pham cptonypham

😇
  • Viet Nam
View GitHub Profile
@cptonypham
cptonypham / multiple_ssh_setting.md
Created February 1, 2021 16:49 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@cptonypham
cptonypham / range.js
Created November 3, 2020 14:55
momentJS create range dates
// Tony Pham
// https://github.com/cptonypham
function range(start, end, type) {
const data = []
while (end.diff(start, type) >= 0) {
data.push(start.format('DD/MM/YYYY'))
start.add(1, type)
}
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
import { NgModule, Component } from "@angular/core";
import {
HttpClientModule,
HttpClient,
HttpHeaders,
HttpParams
} from "@angular/common/http";
import { BrowserModule } from "@angular/platform-browser";
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
@cptonypham
cptonypham / vanilla-js-cheatsheet.md
Created August 13, 2018 19:04 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@cptonypham
cptonypham / numberformat.js
Created July 16, 2017 20:05
number_format(number, decimals, decPoint, thousandsSep) in JavaScript, known from PHP. It formats a number to a string with grouped thousands, with custom separator and custom decimal point
function number_format(number, decimals, decPoint, thousandsSep){
decimals = decimals || 0;
number = parseFloat(number);
if(!decPoint || !thousandsSep){
decPoint = '.';
thousandsSep = ',';
}
var roundedNumber = Math.round( Math.abs( number ) * ('1e' + decimals) ) + '';