This file contains hidden or 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 CommonBundle\Form\Type; | |
use Doctrine\ORM\EntityRepository; | |
use Symfony\Component\OptionsResolver\Options; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormView; |
This file contains hidden or 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 CommonBundle\Form\Type; | |
use Doctrine\ORM\EntityRepository; | |
use Symfony\Component\OptionsResolver\Options; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormView; |
This file contains hidden or 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 | |
/** | |
* Code snippet with math lession | |
* @author Nguyen Nhu Tuan <[email protected]> | |
*/ | |
// 2^3 = 8 | |
echo getExponential(2, 3); | |
echo '<br/>'; |
This file contains hidden or 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'; | |
import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser'; | |
/* | |
* Trust pipe | |
* Usage: | |
* value | safe | |
*/ | |
@Pipe({ | |
name: 'safe' |
This file contains hidden or 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 { Response, RequestOptions, Headers, ResponseContentType } from '@angular/http'; | |
import * as FileSaver from 'file-saver'; | |
/** | |
* Get Audio | |
* | |
* @returns {Promise<Blob>} | |
*/ | |
public getAudio(): Promise<Blob> { | |
let url = `http://example.com/demo.wav`; |
This file contains hidden or 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
.long-text { | |
white-space: -moz-pre-wrap; /* Mozilla */ | |
white-space: -hp-pre-wrap; /* HP printers */ | |
white-space: -o-pre-wrap; /* Opera 7 */ | |
white-space: -pre-wrap; /* Opera 4-6 */ | |
white-space: pre-wrap; /* CSS 2.1 */ | |
white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ | |
word-wrap: break-word; /* IE */ | |
word-break: break-all; | |
} |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 | |
], |
OlderNewer