Skip to content

Instantly share code, notes, and snippets.

View JeffryGonzalez's full-sized avatar

Jeffry Gonzalez JeffryGonzalez

View GitHub Profile
@JeffryGonzalez
JeffryGonzalez / docker-compose.yml
Created November 28, 2023 16:44
Docker Compose with KRaft for Kafka
services:
auth:
image: ghcr.io/navikt/mock-oauth2-server:2.0.0
ports:
- 9999:8080
# Postgres database
db:
image: postgres:15.2-bullseye
restart: always
environment:
@JeffryGonzalez
JeffryGonzalez / .editorconfig
Created June 10, 2023 18:58
My EditorConfig for Visual Studio
[*.{cs,vb}]
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
@JeffryGonzalez
JeffryGonzalez / Dockerfile
Created October 14, 2021 12:13
Example Dockerfile for creating a node image with Chrome
# Closest node to our current version
FROM node:14.18
# apt is a linux package manager. we update our deps and
RUN apt-get update && apt-get install -y \
# install apt-transport-https (allows us to pull down stuff from https)
apt-transport-https \
# ca-certificates (for the certs for https)
ca-certificates \
# curl is a command line tool for doing web requests
curl \
@JeffryGonzalez
JeffryGonzalez / tslint-eslint-update.md
Created April 14, 2021 12:10
Updating from TSLint to ESLint in Angular 11.2 and later

Updating from TSLint to ESLint in Angular 11.2+

The main instructions are here: Instructions. This document shows how to create a new Angular 11.2+ project using ESLint instead of TSLint (and Codelyzer), both of which have been deprecated by Angular and will be removed in some (soon) future version.

Some Notes About Upgrading a Project

  • Your Angular Project must at least version 11.2.0.
  • If it is not, run ng update
import { ShoppingListItem } from '../models';
import { BehaviorSubject, Observable } from 'rxjs';
export class ShoppingDataService {
private fakeData: ShoppingListItem[] = [
{ id: '1', description: 'Ice Cream Cones', purchased: false },
{ id: '2', description: 'Shoe Polish', purchased: true }
];
private maxId = 3;
@JeffryGonzalez
JeffryGonzalez / shoppingservice
Created February 1, 2021 21:11
shoppingservice.ts
‎‎​
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({
selector: '[appNumberFilter]'
})
export class NumberFilterDirective {
invalidChars = [
'-',
'+',
'e',
version: "3.7"
services:
api:
image: libraryapi
depends_on:
- sql
- redis
- rabbit
- worker
ports:
public class CustomWebApplicationFactory<TStartup> :
WebApplicationFactory<TStartup> where TStartup : class
{
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
builder.ConfigureServices(services =>
{
foreach(var kvp in deps)
{
@JeffryGonzalez
JeffryGonzalez / snippets.json
Last active February 3, 2021 15:51
ngrx snippets
{
"NGRX Root Reducer": {
"prefix": "ngrootreducer",
"body": [
"import { ActionReducerMap } from '@ngrx/store';",
"",
"export interface $1 {",
"",
"}",
"",