chatgpt.com
o1
20241217
use meta prompt
https://platform.openai.com/docs/guides/prompt-generation/meta-prompts#meta-prompts
import urllib.request | |
import json | |
def get_public_ip(url): | |
try: | |
req = urllib.request.Request( | |
url, | |
headers={'User-Agent': 'curl/7.74.0'} | |
) | |
with urllib.request.urlopen(req) as response: |
# some alternatives to get date or datetime | |
# in order to get epoch seconds of the beginning of the choosen date | |
# -------------------------------------------------------------------------------- | |
# alternative 1 | |
# -------------------------------------------------------------------------------- | |
from datetime import datetime | |
from zoneinfo import ZoneInfo | |
datetime.now(tz=ZoneInfo('localtime')) | |
# requires an extra std package `zoneinfo` |
/// x.com.js | |
function twitter_demetricator() { | |
// inspired by | |
// https://chrome.google.com/webstore/detail/abcocamcgfjfdcpfopgpadihhbjbdcem | |
console.log("starting twitter demetricator ..."); | |
const spans = document.querySelectorAll('span[data-testid="app-text-transition-container"]'); | |
spans.forEach(span => { | |
const firstChildSpan = span.querySelector('span'); | |
if (firstChildSpan) { | |
const grandsonSpan = firstChildSpan.querySelector('span'); |
(function() { | |
var css = ` | |
body { | |
background: white; | |
} | |
html { | |
filter: invert(100%) hue-rotate(180deg); | |
} | |
img { | |
filter: invert(100%) hue-rotate(180deg); |
chatgpt.com
o1
20241217
use meta prompt
https://platform.openai.com/docs/guides/prompt-generation/meta-prompts#meta-prompts
#!/bin/bash | |
cpu_model=$(lscpu | grep "Model name" | awk -F: '{print $2}') | |
# cpu_model=$(lscpu | grep "Model name" | awk -F: '{print $2}' | tr -d '[:space:]') | |
echo "Benchmarking ssh-keygen with Ed25519 on CPU: $cpu_model" | |
rounds_values=(100 200 500 1000) | |
# rounds_values=(100 200 500 1000 1500 2000 3000 4000 5000) | |
for rounds in "${rounds_values[@]}"; do |
intro to github models
github models
github models rate limits
Okay, I understand the requirements. You want a Tampermonkey userscript that redirects Amazon product URLs to their most concise form, specifically https://www.amazon.es/dp/<product_id>
, regardless of whether the original URL includes the product name or query parameters. Here's a robust solution, along with a detailed explanation:
// ==UserScript==
// @name Amazon URL Cleaner (ES)
// @namespace http://tampermonkey.net/
// @version 0.5
// @description Redirects Amazon.es product URLs to the shortest /dp/ format.
// @author You
// @match https://www.amazon.es/*
Okay, let's break this down.
Yes, it is possible to achieve a color inversion effect in Ghostscript, similar to the invert(100%)
part of your CSS filter. Replicating the hue-rotate(180deg)
part exactly is significantly more complex within Ghostscript's standard processing model, but the simple inversion often gets you 90% of the way to a usable "dark mode".
The core idea is to use PostScript's transfer functions. These functions modify color component values just before they are rendered. To invert a color component c
(where c
is between 0 and 1), the function is simply 1 - c
.
We need to apply this function to all relevant color spaces commonly found in PDFs: DeviceGray, DeviceRGB, and DeviceCMYK.
Here is the Ghostscript command you can use in a Bash shell script:
curl -sSL 'https://ocw.mit.edu/courses/6-172-performance-engineering-of-software-systems-fall-2018/d0c73dd51c79b95196a2e6faa824e1b4_MIT6_172F18_lec1.pdf' -o '6-172-performance-engineering-of-software-systems-lecture-01-introduction-and-matrix-multiplication.pdf' | |
curl -sSL 'https://ocw.mit.edu/courses/6-172-performance-engineering-of-software-systems-fall-2018/1a57adbec9520270d4485b42a2e1a316_MIT6_172F18_lec2.pdf' -o '6-172-performance-engineering-of-software-systems-lecture-02-bentley-rules-for-optimizing-work.pdf' | |
curl -sSL 'https://ocw.mit.edu/courses/6-172-performance-engineering-of-software-systems-fall-2018/cc6983c9ebd77c28e8ae85bc0e575360_MIT6_172F18_lec3.pdf' -o '6-172-performance-engineering-of-software-systems-lecture-03-bit-hacks.pdf' | |
curl -sSL 'https://ocw.mit.edu/courses/6-172-performance-engineering-of-software-systems-fall-2018/8955b91dbd47c241fb2904c700fdb697_MIT6_172F18_lec4.pdf' -o '6-172-performance-engineering-of-software-systems-lecture-04-assembly-language-and-computer-architecture.pdf' | |
c |