This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
#listen [::]:80; #Use this to enable IPv6 | |
server_name example.com www.example.com; | |
root /var/www/example.com/; | |
access_log /var/log/nginx/example-access.log; | |
error_log /var/log/nginx/example-error.log; | |
index index.php index.html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
USE `fashino`$$ | |
DROP FUNCTION IF EXISTS `GeoCalDistanceByLatLon`$$ | |
CREATE DEFINER=`root`@`localhost` FUNCTION `GeoCalDistanceByLatLon`( TYPE ENUM('mi', 'km'), lat1 DECIMAL(10,7), lon1 DECIMAL(10,7), lat2 DECIMAL(10,7), lon2 DECIMAL(10,7) ) RETURNS DECIMAL(10,7) | |
BEGIN | |
RETURN IF(TYPE = 'km', 6371, 3959)*ACOS(SIN(lat1*PI()/180)*SIN(lat2*PI()/180)+COS(lat1*PI()/180)*COS(lat2*PI()/180)*COS((lon2*PI()/180)-(lon1*PI()/180))); | |
END$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sudo vi /etc/nginx/conf.d/example.conf | |
upstream php { | |
server unix:/var/run/php-fpm/php-fpm.sock; | |
server 127.0.0.1:9000; | |
} | |
server { | |
listen 80; | |
server_name example.com www.example.com; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="vi"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Javascript Study - Closure</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//http://www.phptherightway.com/pages/Design-Patterns.html | |
class Automobile | |
{ | |
private $vehicleMake; | |
private $vehicleModel; | |
public function __construct($make, $model) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\Serializer\Normalizer; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; | |
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | |
use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FileUploadModule } from 'ng2-file-upload'; | |
import { ThumbnailDirective } from './thumbnail.directive'; | |
... | |
imports: [ | |
BrowserModule, | |
FormsModule, | |
ReactiveFormsModule, | |
CommonModule, | |
FileUploadModule | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngFor="let item of uploader.queue; let first = first;"> | |
<img src="" thumbnail [image]="item?._file"/> | |
{{ item?.file?.name }} | |
{{ item?.file?.size }} | |
</div> | |
<input type="file" ng2FileSelect [uploader]="uploader" #fileInput [accept]="accept.toString()" [multiple]="multiple"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
/* | |
* Convert bytes into largest possible unit. | |
* Takes an precision argument that defaults to 2. | |
* Usage: | |
* bytes | humanFileSize:precision | |
* Example: | |
* {{ 1024 | humanFileSize}} | |
* formats to: 1 KB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
/* | |
* Format long file name | |
* Max length, default is 100 | |
* Usage: | |
* filename | longFileName:maxLength | |
* Example: | |
* {{ 'demo file name long at here, this is long file name omg please try input now.txt' | longFileName:40}} | |
* formats to: demo file name long ...se try input now.txt |
NewerOlder