Skip to content

Instantly share code, notes, and snippets.

View julianpoemp's full-sized avatar

Julian Pömp julianpoemp

View GitHub Profile
@julianpoemp
julianpoemp / README.md
Last active February 11, 2022 09:45
How to hash files while uploading using multer and typescript. Keywords: nodejs, expressjs, multer, upload, hashing

How to hash files while uploading using multer and typescript

  1. Copy the file 'multer-storage-hashing.ts' to your development directory.
  2. Import the file in your typescript of choice.
  3. Now you can initialize the multer storage:

Example:

const storage = new MulterStorageHashing({
 // ... optional storage options 

Keybase proof

I hereby claim:

  • I am julianpoemp on github.
  • I am julianpoemp (https://keybase.io/julianpoemp) on keybase.
  • I have a public key ASBBDEuP2M-q6-ZGu27TRqD_vinVpiojdJlFTsyevx9l7go

To claim this, I am signing this object:

@julianpoemp
julianpoemp / tslint_allow_leading_underscore.md
Created February 17, 2019 09:08
Allow leading underscores in tslint.config. Very helpful for WebStorm/PHPStorm users.

How to allow leading underscores in tslint.config

Add the following rule at the end of your tslint.config. If it does already exist, change it :)

"variable-name": [
true,
"allow-leading-underscore"
]

Why?

@julianpoemp
julianpoemp / inline-web-worker-typescript.md
Last active March 4, 2024 10:52
Easy inline web worker with Typescript

Easy web worker with Typescript

This code makes use of two classes: TsWorker and TsWorkerJob. TsWorker initializes an inline worker and runs one job. The TsWorker class needs to be initialized with a function and the function's arguments as an array.

Example:

 const tsWorker = new TsWorker();

 // create a new job. You can create a sub class of TsWorker so that you don't have to add the function any time.
@julianpoemp
julianpoemp / SubscriptionManager.ts
Last active August 9, 2023 23:43
Subscription manager for Angular 15, Angular 14, Angular 13, Angular 12, Angular 11, Angular 10, Angular 9, Angular 8, Angular 7, Angular 6 (and less)
/*
Version 1.2.0
For new versions of this class go to https://gist.github.com/julianpoemp/0c4dc13541b863f6503026333eb6b2b6
License: MIT
*/
export class SubscriptionManager<T> {
private subscriptions: {
id: number,
tag: string,
@julianpoemp
julianpoemp / .angular-htaccess.md
Last active November 11, 2023 19:06
Optimal .htaccess configuration for Angular 15, Angular 14, Angular 13, Angular 12, Angular 11, Angular 10, Angular 9, Angular 8, Angular 7, Angular 6, Angular 5 (and older) app in production incl. fix for the angular browser caching issue.

New generator

I created a new htaccess generator for angular apps that makes it easier for you to create the optimal htaccess file: https://julianpoemp.github.io/ngx-htaccess-generator/

The goal of this generator is to create the optimal .htaccess file for Angular apps easily. By default the generator creates an .htaccess file that solves the route redirection issue. To make it easier for you I created a kind of interview mode with some questions. As an additional feature the generator supports adding exclusions for example if you have installed a blog in a subdirectory of your web application and more!

The generator 😁: https://julianpoemp.github.io/ngx-htaccess-generator/

The project: https://github.com/julianpoemp/ngx-htaccess-generator