To be ran with:
- model:
claude-3-opus-20240229 - temperature:
0.0
Context: https://twitter.com/VictorTaelin/status/1776677635491344744
| javascript:(function(){const APP_ID='936619743392459';function csrf(){return document.cookie.match(/csrftoken=([^;]+)/)?.[1];}async function userId(username){const r=await fetch(`https://www.instagram.com/api/v1/users/web_profile_info/?username=${username}`,{headers:{%27x-ig-app-id%27:APP_ID,%27x-requested-with%27:%27XMLHttpRequest%27},credentials:%27include%27});const j=await r.json();return j?.data?.user?.id;}async function block(id){const r=await fetch(`https://www.instagram.com/api/v1/web/friendships/${id}/block/`,{method:%27POST%27,headers:{%27x-csrftoken%27:csrf(),%27x-ig-app-id%27:APP_ID,%27x-requested-with%27:%27XMLHttpRequest%27,%27content-type%27:%27application/x-www-form-urlencoded%27},credentials:%27include%27});return r.ok;}function getUsername(article){const links=[...article.querySelectorAll(%27a[href^="/"]%27)];for(const a of links){const m=a.getAttribute(%27href%27).match(/^\/([^\/]+)\/$/);if(!m)continue;const name=m[1];if([%27p%27,%27reel%27,%27reels%27,%27explore%27,%27stories%27,%27tv%27,% |
To be ran with:
claude-3-opus-202402290.0Context: https://twitter.com/VictorTaelin/status/1776677635491344744
Hi! This is a pair of scripts to easily embed LaTeX figures in Markdown documents.
Before using them, please
TEX_DIR to be the folder where you want to keep the LaTeX stuff (./attachments/diagrams will be fine if you're using Obsidian);PREAMBLE and POSTAMBLE the LaTeX code to sandwitch the code of your figures before compilation;Then, you can use them like this:
| #!/usr/bin/env bash | |
| DB=${1:-my-host} | |
| PORT=${2:-10864} | |
| echo "Opened tunnel on port $PORT to $DB through websocket..." | |
| ssh -N -L localhost:$PORT:/var/run/postgresql/.s.PGSQL.5432 $DB | |
| echo "Closed!" |
| #!/usr/bin/env bash | |
| git filter-branch --env-filter ' | |
| OLD_MAIL="paolo.brasolin@email.com" | |
| NEW_NAME="Paolo Brasolin" | |
| NEW_MAIL="paolo.brasolin@gmail.com" | |
| if [ "$GIT_COMMITTER_EMAIL" = "$OLD_MAIL" ] | |
| then |
Place the formatter in ~/.timetrap/formatters/det.rb and then run
t week -f detto obtain
2019-11-18 10:23 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■⠅⠅⠅⠅⠅⠅⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂
| rndch () { cat /dev/urandom | LC_ALL=C tr -dc '[:graph:]' | head -c $1; }; |
| def self.humanize_bytes(size) | |
| %w[b Kb Mb Gb Tb Pb Eb Zb Yb].reduce(size) do |magnitude, unit| | |
| break "#{magnitude}#{unit}" if magnitude < 1024 | |
| magnitude / 1024 | |
| end | |
| end | |
| def self.humanize_bytes(size) | |
| return "#{size}b" if size < 1024 | |
| return "#{size}Kb" if (size /= 1024) < 1024 |