Skip to content

Instantly share code, notes, and snippets.

View gpolanco's full-sized avatar

Geordano Polanco gpolanco

View GitHub Profile
@gpolanco
gpolanco / automating-nginx-server-block.sh
Created June 7, 2020 09:40
Semi-automating Nginx server block and demo public content
#!/bin/bash
domain=$1
server_block="/etc/nginx/sites-available/$domain"
document_root="/var/www/$domain"
public_html="$document_root/public_html"
index_public_html="$public_html/inde.html"
#===================================================
#================= SERVER BLOCK ===================
@gpolanco
gpolanco / sh
Created July 14, 2019 15:10
Rename file .js to .ts and .jsx to .tsx
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
/* Simple directiva para generar un botón con spinner.
Uso:
<button-loading on-search="$ctrl.buscar()" isloading="functionRequest()" type="btn-default"></button-loading>
Required params: ['onSearch', 'isloading']
*/
// Button loading directive
@gpolanco
gpolanco / authentication.ts
Created July 9, 2017 11:03 — forked from btroncone/authentication.ts
Angular 2 application role access decorator, wrapping built in CanAccess functionality. Prevents view transitions when user roles are not appropriate.
import { Injectable } from 'angular2/core';
import { Storage } from './storage';
import { CurrentUser } from '../interfaces/common';
@Injectable()
export class Authentication{
private _storageService : Storage;
private _userKey : string = "CURRENT_USER";
constructor(storageService : Storage){