Skip to content

Instantly share code, notes, and snippets.

View ditansu's full-sized avatar

Dmitrii ditansu

View GitHub Profile
@jonico
jonico / Jenkinsfile
Last active March 5, 2025 22:51
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 29, 2025 15:57
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@pedantix
pedantix / RouteLoggingMiddleware.swift
Created March 5, 2018 03:57
Vapor 3 Request Logger
final class RouteLoggingMiddleware: Middleware, Service {
func respond(to request: Request, chainingTo next: Responder) throws -> Future<Response> {
let logger = try request.make(Logger.self)
let method = request.http.method
let path = request.http.uri.path
let query = request.http.uri.query
let reqString = "[\(method)]@\(path) with query:\(query)"