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
interface BaseCreateWidgetParam { | |
show_level: hmUI.show_level | |
} | |
interface ImageParam extends BaseCreateWidgetParam{ | |
/** | |
* The path of the image. Reference folder-structure structure. | |
*/ | |
src: string | |
/** |
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 { Observable, throwError } from 'rxjs' | |
import { catchError } from 'rxjs/operators' | |
import { HttpErrorResponse } from '@angular/common/http' | |
export const throwForCodes = (codeErrors: Array<[number, () => Error]>) => { | |
const mappedCodeErrors = new Map(codeErrors) | |
return <T>(source: Observable<T>) => | |
source.pipe(catchError(error => { | |
if (error instanceof HttpErrorResponse) { | |
const mappedErrorFn = mappedCodeErrors.get(error.status) |
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
Show hidden characters
// Файл "tsconfig.json": | |
// - устанавливает корневой каталог проекта TypeScript; | |
// - выполняет настройку параметров компиляции; | |
// - устанавливает файлы проекта. | |
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта. | |
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта. | |
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга. | |
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути. | |
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию. | |
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json". |
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
<form #loginForm="ngForm"> | |
<ion-item> | |
<ion-label floating>CPF/CNPJ</ion-label> | |
<ion-input [(ngModel)]="cpf_cnpj" (blur)="cpf_cnpj = format(cpf_cnpj)" name="cpf_cnpj"></ion-input> | |
</ion-item> | |
<button ion-button full type="submit" color="sicor" (tap)="login(signForm.value)">Login</button> | |
</form> |
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
#!/bin/bash | |
set -e | |
update_version(){ | |
if [[ "$DONT_BUMP_VERSION" -ne "1" ]] | |
then | |
echo " Bumping version.. " | |
else | |
echo "Version will not be bumped since variable DONT_BUMP_VERSION is set." | |
exit 0 |
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 | |
exec("find /var/www/FOLDER/img/ -type f -name '*.jpg' -exec jpegoptim --strip-all {} \;"); | |
exec("find /var/www/FOLDER/img/ -type f -name '*.JPG' -exec jpegoptim --strip-all {} \;"); // Sometimes, .jpg are.. .JPG | |
exec("find /var/www/FOLDER/img/ -type f -name '*.png' -exec optipng -o2 {} \;"); // Level 2, change to -o2 => -o7 | |
mail('[email protected]', 'Server', 'Jpg/Png opti done'); | |
?> |
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
.css3-radios label { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
.css3-radios input[type="radio"] + span { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
.css3-radios input[type="radio"] + span::before { | |
display: inline-block; |
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
ssl_session_cache shared:ssl_session_cache:10m; | |
server { | |
server_name domen.com www.domen.com; | |
listen xxx.xxx.xxx.xxx:80; | |
return 301 https://domen.com$request_uri; | |
} | |
server { | |
server_name domen.com www.domen.com; | |
listen 443 ssl spdy; |
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 | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |
NewerOlder