Skip to content

Instantly share code, notes, and snippets.

Avatar

Miguel Plazas miguelplazasr

  • Pulsar IT
  • Miami, FL
View GitHub Profile
View TAR.md

Tar comprimido

tar -zcvf file_name.tar.gz directory_to_copy/

Tar con exclusiones

tar -zcv --exclude=./directory -f namefile.tar.gz directory_to_copy/
View Docker.md

#Docker Tips

  • Enter to bash
docker run -it --entrypoint /bin/sh
View admin.routing.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CmsResolver } from '../../resolvers/cms.resolver';
import { AdminComponent } from './admin.component';
import { CmsComponent } from './cms/cms.component';
export const routes: Routes = [
{
View cms.resolver.ts
import { Injectable } from '@angular/core';
import { ActivatedRoute, ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { CmsService } from '../services/cms/cms.service';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';
@Injectable()
View api-rest.service.ts
import { Injectable } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Http, Headers, RequestOptions } from '@angular/http';
import 'rxjs/add/operator/map';
import { URL_BASE } from '../app.constants';
import { LoginService } from '../services/login.service';
@Injectable()
View crud.ts
import { OnInit } from '@angular/core';
import { ActionsInterface } from '../interfaces/app.interface';
import { ApiRestService } from '../services/api-rest.service';
export class BaseCrud implements OnInit, ActionsInterface {
end_point: string;
entities:any [];
View entity.component.ts
import { Component, OnInit } from '@angular/core';
import { BaseCrud } from '../../../main-classes/crud';
// Services
import { ApiRestService } from '../../../services/api-rest.service';
// Model
import { Port } from '../../../models/port.model';
@Component({
@miguelplazasr
miguelplazasr / BaseController.php
Created Dec 6, 2016
Base controller for FOSRestController
View BaseController.php
<?php
/**
* Created by PhpStorm.
* User: miguelplazasr
* Date: 10/14/16
* Time: 1:03 PM
*/
namespace AppBundle\Controller\api;
@miguelplazasr
miguelplazasr / app.config.js
Last active Oct 5, 2016
Configura Angular para las traducciones
View app.config.js
/**
* i18n for Angular (https://angular-translate.github.io/)
*
*
*/
(function () {
'use strict';
angular
.module('MyApp')
@miguelplazasr
miguelplazasr / TranslateController.php
Created Oct 5, 2016
Conviert un archivo i18n de Symfony en JSON
View TranslateController.php
namespace AppBundle\Controller\api;
use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Routing\ClassResourceInterface;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Yaml\Yaml;
class TranslateController extends FOSRestController implements ClassResourceInterface