Skip to content

Instantly share code, notes, and snippets.

View AlexRogalskiy's full-sized avatar
🛰️
Work on stuff that matters

Alexander AlexRogalskiy

🛰️
Work on stuff that matters
View GitHub Profile
@AlexRogalskiy
AlexRogalskiy / bitbucket-pipelines.yml
Created February 10, 2023 22:16 — forked from 64BitChris/bitbucket-pipelines.yml
Example BitBucket Pipeline YML file for Maven Projects
image: atlassian/default-image:2
pipelines:
branches:
master: # Trigger this for any pushes to the master branch.
- step:
name: Build and Deploy Snapshot Artifact
trigger: automatic
caches:
- maven # Cache any dependencies we download, speeds up build times.
@AlexRogalskiy
AlexRogalskiy / docker-compose.yml
Created January 12, 2023 07:29 — forked from adamelliotfields/docker-compose.yml
Docker Compose Mongo with Mongo Express
version: "3.5"
services:
mongo:
image: mongo:latest
container_name: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
ports:
@AlexRogalskiy
AlexRogalskiy / postal_codes_regex.json
Created December 25, 2022 22:26 — forked from lkopocinski/postal_codes_regex.json
JSON file with postal codes regex patterns
[
{
"abbrev":"AF",
"name":"Afghanistan",
"postal":"[0-9]{4}"
},
{
"abbrev":"AL",
"name":"Albania",
"postal":"(120|122)[0-9]{2}"
@AlexRogalskiy
AlexRogalskiy / countriesAddressPostal.js
Created December 25, 2022 22:26 — forked from ShreyKumar/countriesAddressPostal.js
List of countries and their respective postal codes with ranges (August 2020)
// Country list source: https://www.dhl.com/en/country_profile.html#.XwODEJNKjOQ
// Country abbreviation source: https://planetarynames.wr.usgs.gov/Abbreviations
// Postal code: https://gist.githubusercontent.com/jamesbar2/1c677c22df8f21e869cca7e439fc3f5b/raw/21662445653ac861f8ab81caa8cfaee3185aed15/postal-codes.json
// Postal code: https://en.wikipedia.org/wiki/List_of_postal_codes
// Country/territory items with no postal code regexes or ranges either do not require postal codes
// or there may not be enough information for that country/territory
export const COUNTRY_ADDRESS_POSTALS = [{
abbrev: 'AF',
@AlexRogalskiy
AlexRogalskiy / postal-codes.json
Created December 25, 2022 22:25 — forked from jamesbar2/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",
@AlexRogalskiy
AlexRogalskiy / HttpRequestLoggingFilter.java
Created November 23, 2022 18:15 — forked from thegeekyasian/HttpRequestLoggingFilter.java
Spring Boot HttpServletRequest Logging Filter. A Request Logging Filter for Spring Boot applications, that allows you to read the request body multiple times. The request body is cached using an overridden HttpServletRequestWrapper. Then a reader that allows the client to read the body multiple times is returned.
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StreamUtils;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.*;
import java.util.*;
@AlexRogalskiy
AlexRogalskiy / settings.gradle.kts
Created November 16, 2022 09:27 — forked from pavlospt/settings.gradle.kts
Automatically discover modules
/**
* Dynamically discover and add modules in our project
* */
val moduleBuildFileName = "build.gradle.kts"
// A pattern to match the prefix of our modules
val eligibleModuleNamePattern = "a_pattern_to_match_our_module_names".toRegex() // (e.g.: (app|android-|kotlin-).*)
// Filter directories that indicate modules
val moduleFilter: FileFilter = FileFilter { pathname: File ->
@AlexRogalskiy
AlexRogalskiy / Main.java
Last active October 25, 2022 23:43
Greedy collection of toys
import java.lang.*;
import java.util.*;
import java.util.stream.*;
import java.util.function.*;
import java.util.concurrent.*;
import static java.util.stream.Collectors.*;
abstract class Toy {
public abstract double volume();
@AlexRogalskiy
AlexRogalskiy / Dockerfile
Created October 14, 2022 01:50 — forked from Tkachenko-Ivan/Dockerfile
Dockerfile для отладки Java приложения, использующего GDAL, в контейнере
FROM ubuntu:20.04
RUN apt-get update
# Set locales
RUN apt-get update && \
apt-get install -y locales && \
locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8

Typesafe Project & Developer Guidelines

These guidelines are meant to be a living document that should be changed and adapted as needed. We encourage changes that makes it easier to achieve our goals in an efficient way.

These guidelines mainly applies to Typesafe’s “mature” projects - not necessarily to projects of the type ‘collection of scripts’ etc.

General Workflow

This is the process for committing code into master. There are of course exceptions to these rules, for example minor changes to comments and documentation, fixing a broken build etc.