Skip to content

Instantly share code, notes, and snippets.

View Bastianowicz's full-sized avatar

Bastian Charlet Bastianowicz

View GitHub Profile
@Bastianowicz
Bastianowicz / util.module.ts
Created February 7, 2023 19:37
Emulator Ready Firebase Function Queues (using Nest.js)
const adminApp = admin.initializeApp();
@Global()
@Module({
providers: [
{
provide: Functions,
useFactory: () => {
if (process.env.FUNCTIONS_EMULATOR) {
// since functions emulator does not know queues or the port is blocked because of this very request
@Bastianowicz
Bastianowicz / FirestoreTransactionAdapter.ts
Created February 7, 2023 19:31
Nest.js Setup for decoupled Firestore Transactions
export class FirebaseTransactionAdapter implements TransactionProviderPort {
private readonly logger = new Logger(FirebaseTransactionAdapter.name);
constructor(
@Inject(Firestore.prototype.runTransaction)
private readonly runTransaction: TransactionRunner,
) {
}
async executeTransaction(
@Bastianowicz
Bastianowicz / Controller.ts
Last active November 15, 2021 17:00
Nestjs Decorator to mark Models properties as sortable and Validtor to check if given properties are sortable
@Get()
async get(
@Req() req: Request,
@Query() orderQueryParams?: OrderQueryParam<IItemResponse>
): Promise<{ items: IItemResponse[] }> {
// your code here...
}
@Bastianowicz
Bastianowicz / welcome games.md
Last active January 26, 2021 15:13
get to know each other games

3 Facts, 1 Lie

Tell the others 3 facts about yourself whereas one is a lie. Let the others guess what was the lie.

Standup aggregates

Prepare 5 True/False questions on big sheats of paper. Expose one question at a time standing behind the "newbie" and let them guess what the question is. e.g.: I am developper. I like beer. I do a lot of sports. I am working here for more than 5 years, ...

Special Unit Welcome

Prepare a number of tasks for everyone participating in the meeting. Shuffle them and let everyone pick one of the tasks. While introducing themselfs they have to fulfill the task. You get a point for

  • either introducing yourself without having the others figure your task
@Bastianowicz
Bastianowicz / semver-order-datastudio.md
Created April 14, 2020 11:25
Order Semantic Version in Datastudio

Problem

Datastudio only provides ordering in 2 Dimensions. This is a problem when you want to order semantic versions of an application.

Solution

  • make major, minor and patch version accessable as single fields
  • Create a field in datastudio or in your data connector for your order like this

(major_version * 1000000) + (minor_version * 1000) + patch_version

  • order your list by this number
@Bastianowicz
Bastianowicz / mongodb docker aws dataloss.md
Last active October 17, 2021 17:06
Solved: MongoDB in Docker (AWS ECS) loses all the data after redeployment

MongoDB in Docker loses all collections after Redeploy on AWS ECS

Setup:

  • MongoDB image running in ECS on EC2 t2.small
    • Task has a volume added that is "shared" and should thus survive the recreation its container
    • tasks container has the volume mounted on /data

Reproduction:

  • Insert a document
  • (force) redeploy the task
@Bastianowicz
Bastianowicz / specialUnicode.ahk
Created December 18, 2014 16:26
Put special Unicode characters
; Needs to be run in AutoHotkey 1.1+ for better Unicode-Support
^!r::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad7}{Numpad4}{ALTUP}
^!c::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad6}{Numpad9}{ALTUP}
^!t::Send, {ALTDOWN}{Numpad0}{Numpad1}{Numpad5}{Numpad3}{ALTUP}
^!v::SendInput ✓
^NumpadSub::SendInput —
@Bastianowicz
Bastianowicz / newFile.ahk
Created December 18, 2014 16:24
Create a new File with AutoHotkey on Windows
#IfWinActive, ahk_class CabinetWClass
^!n::
KeyWait Alt
Send {AppsKey}
Send n
Send t
return
#IfWinActive