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
RewriteEngine on | |
RewriteCond %{HTTP_REFERER} !^$ | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?cursosdesarrolloweb.es [NC] | |
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L] |
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
#BLOQUEAR VARIAS IPS | |
Order Deny,Allow | |
Deny from 111.111.111.111 | |
Deny from 222.222.222.222 | |
Deny from 333.333.333.333 | |
#BLOQUEAR TODAS LAS IPS QUE EMPIEZAN POR 111.111 | |
Deny from 111.111. | |
Deny from 111.111.111.111/24 |
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 { InMemoryDbService } from 'angular-in-memory-web-api'; | |
export class InMemoryDataService implements InMemoryDbService { | |
createDb() { | |
const users = [ | |
{ | |
"id": "5a5129deae0033d5cf201c5a", | |
"index": 0, | |
"guid": "1dc17b55-3849-497b-800b-59ab245e42d5", | |
"isActive": false, |
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 { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { AppRoutingModule } from './app-routing.module'; | |
import { AppComponent } from './app.component'; | |
import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api'; | |
import { InMemoryDataService } from './in-memory-data.service'; | |
import {HttpClientModule} from '@angular/common/http'; |
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 { Injectable }from '@angular/core'; | |
import { HttpClient, HttpHeaders }from '@angular/common/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/observable/throw'; | |
import 'rxjs/add/operator/catch'; | |
import {User} from './user'; | |
const cudOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/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
enum Genders { | |
male = "male", | |
female = "female" | |
} | |
export class User { | |
id: string | number; | |
index: number; | |
guid: string; | |
isActive: boolean = false; |
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 { Injectable }from '@angular/core'; | |
import { HttpClient, HttpHeaders }from '@angular/common/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import { catchError, tap } from 'rxjs/operators'; | |
import {User} from './user'; | |
import {of} from "rxjs/observable/of"; | |
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/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
/*****/ | |
import {UsersService} from "./users.service"; | |
@NgModule({ | |
/*****/ | |
providers: [UsersService], | |
/*****/ | |
}) |
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 { Component } from '@angular/core'; | |
import {UsersService} from "./users.service"; | |
import {User} from "./user"; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { |
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
<button (click)="getUsers()">All users</button> | |
<button (click)="getUser('5a5129de2339249df56a2ebc')">Find user</button> | |
<button (click)="addUser()">Add user</button> | |
<button (click)="updateUser()">Update user</button> | |
<button (click)="deleteUser('5a5129deba80342a8069ddcb')">Delete user</button> |