Skip to content

Instantly share code, notes, and snippets.

@matzar
matzar / .releaserc
Created August 28, 2023 10:42
.releaserc is a configuration file for semantic-release, dictating automated versioning based on commit conventions, targeting the main branch, and utilizing the "angular" preset with custom release rules for different commit types while integrating with GitHub.
{
"branches": [
"main"
],
"debug": true,
"ci": true,
"dryRun": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
@matzar
matzar / Dockerfile
Last active November 29, 2023 11:41
Multi-stage build Dockerfile for a Node.js application that uses the NX workspace and Nginx as a web server for the runtime environment.
# Use a specific version of the official Node.js image based on the slim variant
FROM node:18.16.0-bullseye-slim AS build
# Set the working directory
WORKDIR /usr/src/app
# Copy required files for installing dependencies
COPY package.json package-lock.json nx.json tsconfig.base.json decorate-angular-cli.js ./
COPY apps/<app-name>/ ./apps/<app-name>/
COPY apps/<app-name>-e2e/ ./apps/<app-name>-e2e/
@matzar
matzar / nginx.conf
Created May 17, 2023 14:11
This nginx.conf file configures an NGINX server to listen on port 8100 on localhost, serving static files from /usr/share/nginx/html and routing all requests to index.html if a specific file or directory is not found.
server {
listen 8100;
server_name localhost;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}
@matzar
matzar / .zshrcOR.bash_profile
Last active August 15, 2022 09:35
git bash aliases and functions to improve your workflow.
# Copy and paste the contents of this file to your .zshrc or .bash_profile file.
#
# Example use:
# to commit with only one letter go:
#
# c feat: your commit message
#
# In the above example, the following would happen:
# - Your changes would be staged for commit
# - A commit with a message - "feat: your commit message" - would be created.
#include <iostream>
#include <string>
#include <algorithm>
#include <regex>
/*
source: http://www.techiedelight.com/remove-whitespaces-string-cpp/
1. space ' '
2. line feed '\n'
3. carriage return '\r'
class GamePlayer {
private:
enum { NumTurns = 5 }; // “the enum hack” — makes
// NumTurns a symbolic name for 5
int scores[NumTurns]; // fine
...
};
#include <iostream>
int main()
{
const std::string myString = "My Hello World Wow";
// C++17
if (const auto it = myString.find(" "); it != std::string::npos)
std::cout << "Space found! Index number: " << it << std::endl;
else
//
// main.cpp
// RemoveElementFromVector
//
// Created by Mateusz Zaremba on 07/04/2018.
// Copyright © 2018 Mateusz Zaremba. All rights reserved.
//
#include <iostream>
#include <algorithm>