Skip to content

Instantly share code, notes, and snippets.

View michaelhenrique182's full-sized avatar

Michael Henrique michaelhenrique182

View GitHub Profile
<input type="date" [ngModel] ="dt | date:'yyyy-MM-dd'" (ngModelChange)="dt = $event">
@michaelhenrique182
michaelhenrique182 / queryparams-router.ts
Created January 2, 2018 12:03
[Angular] Router Query Params
-- no template
<a [routerLink]="['users']" [queryParams]="{ page: 87 }">Ir para página 87 de usuários</a>
-- no componente (ou serviço)
goTo(page: number) {
this.router.navigate(['/users'], { queryParams: { page: page } });
}
@michaelhenrique182
michaelhenrique182 / angular-interceptors.ts
Created January 4, 2018 12:30
[Angular] Http Interceptors
// Como declarar um interceptor
@NgModule({
imports: [ ..., HttpClientModule ],
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: MeuInterceptor, multi: true } // <====
],
...
})
export class ModuloRespectivo {}
@michaelhenrique182
michaelhenrique182 / jenkins-pipeline.groovy
Created January 12, 2018 17:35 — forked from cyrille-leclerc/jenkins-pipeline.groovy
Jenkins Pipeline Script for maven-release-plugin
#!groovy
docker.image('cloudbees/java-build-tools:0.0.6').inside {
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
extensions: [
/* [$class: 'UserIdentity', email: '[email protected]', name: 'Jenkins as a Service'], */
[$class: 'WipeWorkspace'],
[$class: 'LocalBranch', localBranch: 'master']],
userRemoteConfigs: [[credentialsId: 'github-credentials', url: 'https://github.com/cyrille-leclerc/my-spring-boot-app.git']]])
docker rmi $(docker images -q -f dangling=true)
@michaelhenrique182
michaelhenrique182 / gist:f0606dc1d552a8c5251efa2df4a77c5c
Last active January 19, 2018 18:52 — forked from ivan-loh/gist:ee0d96c3795e59244063
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max_old_space_size=1024 app.js # increase to 1gb
node --max_old_space_size=2048 app.js # increase to 2gb
node --max_old_space_size=3072 app.js # increase to 3gb
node --max_old_space_size=4096 app.js # increase to 4gb
node --max_old_space_size=5120 app.js # increase to 5gb
node --max_old_space_size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max_old_space_size=1024" # increase to 1gb
@michaelhenrique182
michaelhenrique182 / IntelliJ_IDEA__Perf_Tuning.txt
Created April 5, 2018 11:35 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@michaelhenrique182
michaelhenrique182 / 01.ts
Created April 7, 2018 13:25 — forked from rahulrsingh09/01.ts
Angular HTTP
import {HttpClientModule} from '@angular/common/http';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule
],
@michaelhenrique182
michaelhenrique182 / elasticsearch-cheatsheet.txt
Created June 9, 2018 18:27 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,