Skip to content

Instantly share code, notes, and snippets.

View mpetuska's full-sized avatar
🇪🇺

Martynas Petuška mpetuska

🇪🇺
View GitHub Profile
# azure-pipelines-backend.yml
pool:
vmImage: 'ubuntu-latest'
trigger:
- master
pr:
- master
name: $(Rev:r)
variables:
parameters:
- name: workingDirectory
default: .
type: string
- name: packageManager
default: yarn
values:
- yarn
- npm
- name: bundleDir
parameters:
- name: workingDirectory
default: .
type: string
- name: dockerGroup
default: ''
- name: tagLatest
default: true
- name: bundleDir
default: build/
parameters:
- name: workingDirectory
default: .
type: string
- name: jfrogUser
- name: jfrogToken
- name: imagesToPush
type: object
default: []
parameters:
- name: packageManager
default: yarn
values:
- yarn
- npm
- name: jfrogUser
- name: jfrogToken
- name: bundleDir
default: build/
parameters:
# Node
- name: workingDirectory
default: .
type: string
- name: packageManager
default: yarn
values:
- yarn
- npm
pool:
vmImage: 'ubuntu-latest'
trigger:
- master
pr:
- master
name: $(Rev:r)
parameters:
- name: disableSonarQube
@mpetuska
mpetuska / README.md
Last active January 8, 2022 17:58
Utility script to find and run the nearest gradle wrapper.

Installation

  1. Download the raw script: curl -o ~/.local/bin/gradlew https://gist.githubusercontent.com/mpetuska/86c05e02b2199e5a2f186da0c2c3f2fd/raw/gradlew.sh
  2. Adjust permissions: chmod +x ~/.local/bin/gradlew
  3. (Optional) Make a shortcut: ln -s ~/.local/bin/gradlew ~/.local/bin/gw

There's also an installation script available:

curl https://gist.githubusercontent.com/mpetuska/86c05e02b2199e5a2f186da0c2c3f2fd/raw/installGW.sh | bash
@mpetuska
mpetuska / README.md
Last active June 23, 2021 08:38
Script to convert a directory of files to a kotlin file with const vals of file contents

Description

A script to read all files in a given directory and convert their content to kotlin's const val file_name = """file content"""

Running

The script expects kotlinc to be on the path.

  1. Download the dirToKt.kts file
  2. Make it executable chmod +x dirToKt.kts
  3. Run is like any other script ./dirToKt.kts [targetDirectory] [outputFile]

Alternatively you could run it with kotlinc directly: kotlinc -script dirToKt.kts [targetDirectory] [outputFile]

@mpetuska
mpetuska / JSObj.kt
Created October 14, 2021 10:49
Fluent Kotlin DSL for building JSON trees
@DslMarker
annotation class JSBuilderDsl
@DslMarker
annotation class JSSetterDsl
data class JSObj(val map: MutableMap<String, Any?> = mutableMapOf()) : MutableMap<String, Any?> by map {
object Arr {
@JSBuilderDsl
operator fun get(vararg items: Any?) = items