Skip to content

Instantly share code, notes, and snippets.

@graste
graste / Noaisearch.md
Created May 30, 2025 05:55
No AI search Google duckduckgo
@graste
graste / gist:96e6f350e96e354338dde010b9a4eeff
Created May 24, 2025 19:46 — forked from jamesgmarks/gist:56502e46e29a9576b0f5afea3a0f595c
MySQL/MariaDB BIN_TO_UUID and UUID_TO_BIN Polyfill
DELIMITER //
CREATE FUNCTION BIN_TO_UUID(b BINARY(16))
RETURNS CHAR(36)
BEGIN
DECLARE hexStr CHAR(32);
SET hexStr = HEX(b);
RETURN LOWER(CONCAT(
SUBSTR(hexStr, 1, 8), '-',
SUBSTR(hexStr, 9, 4), '-',
author: @sleepyfox
title: Expertise and interviews
date: 23-Apr-2023

Expertise and interviews

In 2001 Paul Graham, founder of Startup Incubator Y Combinator wrote a blog post about LISP called 'Beating the averages'. I don't want to talk about LISP, or startups, not today anyway.

@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