Skip to content

Instantly share code, notes, and snippets.

View trungpv1601's full-sized avatar
🤖
Diversifying; Practical; more code than talk.

trungpv trungpv1601

🤖
Diversifying; Practical; more code than talk.
View GitHub Profile
@trungpv1601
trungpv1601 / Laravel PHP7 LEMP AWS.md
Created July 28, 2017 05:35 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@trungpv1601
trungpv1601 / README.MD
Last active August 9, 2017 03:46
Problem Call Store Procedure PDO with MS SQL

If you are using a stored procedure then use

SET NOCOUNT ON 

The problem is that the stored procedure returns a result containing the number of rows affected as the first result.

$NULL = NULL;
@trungpv1601
trungpv1601 / elasticsearch-es-delete-all-data.md
Created August 25, 2017 13:01 — forked from diegopacheco/elasticsearch-es-delete-all-data.md
How to Delete All Data in Elasticsearch?
curl -XDELETE localhost:9200/*
@trungpv1601
trungpv1601 / index.html
Last active September 11, 2017 03:34
HTML to PDF wkhtmltopdf : Problem row table break page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Lexor Sale Order</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<style>
@import url(https://fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,700,700italic);table,tr{page-break-inside:avoid}table{padding:.1875in .25in;border-collapse:collapse;border-spacing:0;background-color:transparent}tr{page-break-after:auto}thead{display:table-header-group}tfoot{display:table-footer-group}body,html,td,th{padding:0}body,html{height:100%;width:100%;margin:0;left:0;top:0;font-size:100%}.center,.container{margin-left:auto;margin-right:auto}*{font-family:Lato,Helvetica,sans-serif;line-height:1.5}h1{font-size:2.5rem}h2{font-size:2rem}h3{font-size:1.375rem}h4{font-size:1.125rem}h5{font-size:1rem}h6{font-size:.875rem}p{font-size:1.125rem;font-weight:200;line-height
@trungpv1601
trungpv1601 / youtubedl.mp3.sh
Last active September 19, 2017 13:29 — forked from rugbyprof/youtubedl.mp3.sh
youtube dl as mp3
youtube-dl --extract-audio --audio-format mp3 <video URL>
youtube-dl -i "<Youtube URL>" -o "%(title)s.%(ext)s" --extract-audio --audio-format "mp3" --audio-quality "192k"
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 URL
@trungpv1601
trungpv1601 / ts-dl.sh
Created September 13, 2017 08:48 — forked from katopz/ts-dl.sh
Download .ts video file by ffmpeg via .m3u8
# Install ffmpeg
brew install ffmpeg
# Download
ffmpeg -i https://foo.com/bar.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4
@trungpv1601
trungpv1601 / README.MD
Created October 5, 2017 08:15
How to Rename A React Native App
  • Copy your icons from iOS and Android
  • Update displayName in app.json to the new name
  • Delete ios/ and android/ directories
  • Run react-native eject
  • Replace the icons you copied earlier
  • Run react-native link
  • Start your app and hope it worked! Or read the rest of this tutorial.
@trungpv1601
trungpv1601 / install.sh
Created November 10, 2017 06:44 — forked from indreklasn/install.sh
init our node project, install next, react, react-dom, making /pages dir
mkdir next-react-ssr && cd next-react-ssr && npm init -y && npm install --save react react-dom next && mkdir pages
@trungpv1601
trungpv1601 / README.MD
Last active May 13, 2018 16:41
React Native: Hide TabBar React Navigation when Keyboard is activated
import React from 'react'
import { Keyboard } from 'react-native'
import { TabBarBottom } from 'react-navigation'

class TabBarComponent extends React.PureComponent {

  constructor(props) {
    super(props)
@trungpv1601
trungpv1601 / uuids.php
Created November 21, 2017 03:53 — forked from renebakx/uuids.php
Laravel 5.4 UUID Trait
<?php
namespace App\Traits;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Ramsey\Uuid\Uuid;
trait Uuids {