Skip to content

Instantly share code, notes, and snippets.

View ossistyle's full-sized avatar
💭
I may be slow to respond.

Thomas Hoffmann ossistyle

💭
I may be slow to respond.
View GitHub Profile
@rezanid
rezanid / Postman-PreRequest-Authentication.js
Last active March 10, 2025 14:56
Postman Pre-Request script to authenticate and refresh authentication token using OAuth2 device flow
// Environment Variables:
// url: <your-resource> example: https://myfancyapp.crm4.dynamics.com
// clientid: <user-clientid-from-appreg> example: 1950a258-227b-4e31-a9cf-717495945fc2
// To know how to use this script, please read the following blog post:
// https://bycode.dev/2024/04/04/automatically-authenticate-in-postman-with-pre-request-scripts/
const utils = {
auth: {
message: "",
async refreshAuth() {
@paulmwatson
paulmwatson / cypress_test_404_spec.js
Created January 14, 2021 08:33
Testing a 404 page with Cypress
cy.visit('/404')
//=> Test fails
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes but does not test the HTTP code was 404
cy.request({url: '/404', failOnStatusCode: false}).its('status').should('equal', 404)
cy.visit('/404', {failOnStatusCode: false})
//=> Test passes, tests that the HTTP code was 404, and tests page was visited
@ricardo-dlc
ricardo-dlc / README.md
Last active March 19, 2025 22:46
Update Jenkins Inside a Docker Container

First identify your image.

$ docker ps --format "{{.ID}}: {{.Image}} {{.Names}}"
3d2fb2ab2ca5: jenkins-docker jenkins-docker_1

Then login into the image as root.

$ docker container exec -u 0 -it jenkins-docker_1 /bin/bash
@mschubert
mschubert / Makefile
Last active February 14, 2025 10:21
Simple function to delegate target creation to another Makefile without losing dependency information
# Consider the following setup:
#
# root
# + a
# | + Makefile
# | + ..some other files..
# + b
# + Makefile
# + ..some other files..
#