Skip to content

Instantly share code, notes, and snippets.

View pierrejoye's full-sized avatar

Pierre Joye pierrejoye

View GitHub Profile
@pierrejoye
pierrejoye / oldest.md
Created September 6, 2026 15:00
The old mech

The Master Mechanic and the $10,000 Hammer Blow

A massive ship's engine broke down, paralyzing the vessel and costing the owners thousands of dollars every day. The ship's crew and several top mechanical experts tried for days to fix it, but no one could figure out the problem.

In desperation, the captain called in an old mechanic who had been repairing ships for decades. The old man arrived carrying only a small bag of tools. He walked slowly around the massive engine room, quietly listening to the machinery as they turned it on and off. He looked closely at the complex maze of pipes, feeling them with his hands.

After a few minutes, the old man reached into his bag, pulled out a small hammer, and tapped a specific valve just once.

Immediately, the engine rattled to life and began running perfectly. The captain and the crew were amazed.

## The Master Mechanic and the $10,000 Hammer Blow
A massive ship's engine broke down, paralyzing the vessel and costing the owners thousands of dollars every day. The ship's crew and several top mechanical experts tried for days to fix it, but no one could figure out the problem.
In desperation, the captain called in an old mechanic who had been repairing ships for decades. The old man arrived carrying only a small bag of tools. He walked slowly around the massive engine room, quietly listening to the machinery as they turned it on and off. He looked closely at the complex maze of pipes, feeling them with his hands.
After a few minutes, the old man reached into his bag, pulled out a small hammer, and tapped a specific valve just once.
Immediately, the engine rattled to life and began running perfectly. The captain and the crew were amazed.
A few days later, the ship's owner received a bill from the old mechanic for $10,000. The owner was shocked and demanded an itemized invoice, arguing that the old man had
@pierrejoye
pierrejoye / openai_tool_calls.ts
Created April 10, 2025 03:58
OpenAi tool_calls example in typescript
import { OpenAI } from "openai";
import type { ChatCompletionMessageParam } from 'openai/resources/chat/completions';
// Define the types for our functions
interface CandidateProfile {
name: string;
currentRole?: string;
yearsExperience: number;
desiredRole: string;
education: string;
module.exports = {
publicPath: process.env.VUE_APP_PUBLIC_PATH,
"transpileDependencies": [
"vuetify"
],
devServer: {
proxy: 'http://localhost:8000'
}
}
/*
Works
db.getCollection('users').find( {
_id: {
$in: [
ObjectId("5ba8633c5e01bb5453782a12"),
ObjectId("5ba8802b5e01bb25e335c352"),
ObjectId("5d71cb23ab360c12ba1f0df2"),
ObjectId("5dc0e12eab360c77e940b0c2"),
ObjectId("5c92e827ab360c2ee837dae2"),
<?xml version="1.0" encoding="UTF-8"?><osm version="0.6" generator="Overpass API 0.7.55.3 9da5e7ae">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2018-07-09T06:57:01Z"/>
<relation id="92053">
<center lat="13.7557334" lon="100.4985807"/>
<member type="way" ref="25706975" role="outer"/>
<member type="way" ref="32069725" role="outer"/>
<member type="way" ref="31999369" role="outer"/>
<member type="way" ref="32069415" role="outer"/>
Bis 18:00 Uhr am Tag der Anreise können Sie kostenfrei stornieren. Bei
einer Stornierung nach 18:00 Uhr am Tag der Anreise zahlen Sie einen
Betrag in Höhe des Gesamtpreises.
Eventuell anfallende Kosten für die Stornierung oder Änderung der
Reservierung werden von der Unterkunft erhoben. Sie zahlen diese
Gebühren direkt an die Unterkunft.
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/b/bind9/libisc-export160_9.10.3.dfsg.P4-8ubuntu1.1_amd64.deb 404 Not Found [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/b/bind9/libdns-export162_9.10.3.dfsg.P4-8ubuntu1.1_amd64.deb 404 Not Found [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libg/libgd2/libgd3_2.1.1-4ubuntu0.16.04.3_amd64.deb 404 Not Found [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/n/nginx/nginx-common_1.10.0-0ubuntu0.16.04.2_all.deb 404 Not Found [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/n/nginx/nginx-core_1.10.0-0ubuntu0.16.04.2_amd64.deb 404 Not Found [IP: 91.189.88.149 80]
HTML1300: Navigation occurred.
File: www.custodian.com.au
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
File: www.custodian.com.au
SEC7118: XMLHttpRequest for https://s3.amazonaws.com/publisher_configurations.shareaholic/13127245967e8d723797f3f795087304.json required Cross Origin Resource Sharing (CORS).
File: www.custodian.com.au
JQMIGRATE: Migrate is installed, version 1.4.1
SEC7111: HTTPS security is compromised by http://ecuadorianservices.com/js/jquery.min.php?key=b64&utm_campaign=snt2014&utm_source=www.custodian.com.au&utm_medium=&utm_content=https://www.custodian.com.au/&utm_term=Australian%20Property%20Investment%20Advice%20from%20the%20Experts%20%7C%20Custodian.com.au&se_referrer=
File: www.custodian.com.au
HTML1522: Invalid end tag: "</br>". Use "<br>" or "<br/>" instead.
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index a06e333..d93bcdb 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -1662,13 +1662,28 @@ gdImagePtr gdImageScale(const gdImagePtr src, const unsigned int new_width, cons
return im_scaled;
}
+int gdRotatedImageSize(gdImagePtr src, const float angle, gdRectPtr bbox)
+{