Skip to content

Instantly share code, notes, and snippets.

View rvanlaak's full-sized avatar

Richard van Laak rvanlaak

View GitHub Profile
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active June 4, 2025 16:03
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@pjcdawkins
pjcdawkins / .gitlab-ci.yml
Last active January 24, 2025 13:08
GitLab - Platform.sh CI scripts
stages:
- review
- cleanup
variables:
# The Platform.sh project ID.
PF_PROJECT_ID: abcdefg123456
push-platformsh:
# This Docker image installs the Platform.sh CLI (and PHP, Git and SSH).
@lsloan
lsloan / Postman current timestamp for UTC as ISO 8601.md
Last active September 4, 2023 11:44
Postman current timestamp for UTC as ISO 8601

I wanted to know: How can I get the current timestamp for UTC in ISO 8601 format to appear in the body data of a Postman request?

After reading some of the Postman documentation and online comments, this is the solution (using Postman v5.0.1 for Chrome 58.0.3029.110 on macOS 10.12.5) I used:

  1. In the Builder, while editing a request, click the "Pre-request Script" heading below the URL field.

  2. In the editor field that appears, enter this single line of JavaScript:

    postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 4, 2025 16:25
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@malarzm
malarzm / MemoryGuard.php
Last active March 26, 2024 21:18
PHPUnit's MemoryGuard
<?php
declare(strict_types=1);
namespace Answear\DevelopmentHelpers\PHPUnit;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;