Skip to content

Instantly share code, notes, and snippets.

@graste
graste / race-condition-probe.java
Created April 24, 2025 04:38 — forked from albinowax/race-condition-probe.java
Race condition custom action for Burp Repeater
// This will use the single-packet attack for HTTP/2, and last-byte synchronisation for HTTP/1
int NUMBER_OF_REQUESTS = 10;
var reqs = new ArrayList<HttpRequest>();
for (int i = 0; i < NUMBER_OF_REQUESTS; i++) {
reqs.add(requestResponse.request());
}
var responses = api().http().sendRequests(reqs);
var codes = responses.stream().map(HttpRequestResponse::response).map(HttpResponse::statusCode).toList();
logging().logToOutput(codes);
@graste
graste / Git Subtree basics.md
Created April 15, 2025 11:16 — forked from SKempin/Git Subtree basics.md
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@graste
graste / falsehoods-programming-time-list.md
Created January 17, 2025 22:32 — forked from timvisee/falsehoods-programming-time-list.md
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).
@graste
graste / text_to_timestamp.sql
Created December 8, 2024 16:18 — forked from jgaskins/text_to_timestamp.sql
Parse Postgres TIMESTAMPs from JSON blobs
CREATE FUNCTION text_to_timestamp(text) RETURNS TIMESTAMP
LANGUAGE sql IMMUTABLE AS
$$
SELECT CASE
WHEN $1 ~ '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(\.\d+)?$' THEN
CAST($1 AS timestamp without time zone)
END
$$;
CREATE TABLE t (
@graste
graste / Scramble text.md
Created November 3, 2024 14:13
scramble text with CSS
@graste
graste / get_geojson.md
Created October 30, 2024 20:00 — forked from knudmoeller/get_geojson.md
Get WGS84-GeoJSON from WFS with Soldner-Coordinates

Get WGS84-GeoJSON from WFS with Soldner-Coordinates

The problem: get GeoJSON data from a WFS that uses a projection other than WGS84. This is e.g. true for all geo data in Berlin's FIS-Broker GIS. The data there uses the "Soldner" projection (or EPSG:25833).

Download as XML

@graste
graste / css-2024-reading-list.md
Created October 5, 2024 22:28 — forked from jensgro/css-2024-reading-list.md
State of CSS 2024 Reading List

CSS 2024 Reading List

lvh / lvw / lvmin / lvmax, sv*, dv*, etc.

The CSS data type represents a distance value. Lengths can be used in numerous CSS properties, such as width, height, margin, padding, border-width, font-size, and text-shadow.

Anchor Positioning

  • Future CSS: Anchor Positioning (kizu.dev)
@graste
graste / base.css
Created October 5, 2024 22:26 — forked from jensgro/base.css
Eine Art Reset-Normalisierung :-)
*,
::after,
::before {
box-sizing: border-box;
}
html {
font-size: 16px;
}
@graste
graste / foxs-laws-of-software-development.md
Created September 21, 2024 19:04 — forked from sleepyfox/foxs-laws-of-software-development.md
Fox's Laws of Software Development
author: @sleepyfox
title: Fox's laws of software development
date: 27 October 2021
preamble: A not entirely serious treatise on the immutable fundamental laws of software development activities

Fox's laws of software development

A not entirely serious treatise