Skip to content

Instantly share code, notes, and snippets.

Avatar

Hernan Castilla hcastillaq

View GitHub Profile
View app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { EntityDataModule } from '@ngrx/data';
import { entityConfig } from './entity-metadata';
import { EffectsModule } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { HttpClientModule } from '@angular/common/http';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
@hcastillaq
hcastillaq / base.service.ts
Created Apr 29, 2020
Angular Service - BaserService for HttpRequests, declare all methods and implement this class in other services
View base.service.ts
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
@Injectable({
providedIn: 'root',
})
export class BaseService {
constructor(private http$: HttpClient) {}
get(url, params: HttpParams = new HttpParams()) {
@hcastillaq
hcastillaq / ci_gitlab
Created Jan 24, 2020
ci gitlab basico
View ci_gitlab
build:
image: node:latest
stage: build
script:
- rm package-lock.json
- npm install --progress=false
- npm run production --no-progress
artifacts:
expire_in: 10 mins
paths:
View ci_gitlab
deploy:
image: alpine
stage: deploy
script:
- apk add --no-cache rsync openssh
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
- chmod 600 ~/.ssh/id_dsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- touch hola.txt
@hcastillaq
hcastillaq / keybindings.json
Created Jan 16, 2020
keybindings for vscode
View keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "alt+left",
"command": "workbench.action.navigateBack"
},
{
"key": "ctrl+alt+-",
"command": "-workbench.action.navigateBack"
},
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/hcastillaq/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(git zsh-syntax-highlighting zsh-autosuggestions node npm)
View tmux.config
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix 'M'
bind-key -n 'M' send-prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
@hcastillaq
hcastillaq / vscode.json
Last active Jan 15, 2020
vscode config con operator mono
View vscode.json
{
"editor.fontFamily": "Operator Mono SSm Lig Light",
"terminal.integrated.fontFamily": "'Operator Mono SSm Lig Light'",
"editor.fontWeight": "normal",
"editor.fontLigatures": true,
"editor.fontSize": 14.5,
"editor.tabSize": 2,
"editor.tabCompletion": "on",
"workbench.colorTheme": "Monokai",
View manifest.json
{"short_name":"hcastillaq","name":"Blog personal de Hernan Castilla","start_url":"/","background_color":"#212121","display":"standalone","theme_color":"#1d1f21","icons":[{"src":"/imagenes/x48.png","type":"image/png","sizes":"48x48"},{"src":"/imagenes/x96.png","type":"image/png","sizes":"96x96"},{"src":"/imagenes/x192.png","type":"image/png","sizes":"192x192"},{"src":"/imagenes/x512.png","type":"image/png","sizes":"512x512"}]}
View sw.js
var CACHE_NAME = "hcq-cache";
var urlToCache = [
'/',
'/index.html',
'/css/fonts/MesloLGM-Regular.ttf'
];
self.addEventListener('install', function(event)
{