ruby -retc -e 'puts Etc.nprocessors'
python -c "import multiprocessing; print(multiprocessing.cpu_count())"
| /* | |
| Simple interaction w/ this agent: | |
| User -> what's the time in Moscow? | |
| Agent -> The current time in Moscow is 23:14:03 MSK on 2026-08-27. | |
| User -> what's the weather in Toronto, Canada? | |
| Agent -> The weather in Toronto is 26.2°C, with 51% humidity and wind at 16.2 km/h. | |
| User -> compare the weather in Toronto and San Juan, PR |
| // Zed settings | |
| { | |
| "icon_theme": "Catppuccin Mocha", | |
| "auto_update_extensions": { | |
| "powershell": false | |
| }, | |
| "show_edit_predictions": true, | |
| "edit_predictions": { | |
| "mode": "eager" | |
| }, |
| #!/usr/bin/env elixir | |
| # | |
| # Simple example for concurrent request in Elixir | |
| # | |
| Mix.install([ | |
| {:req, "~> 0.5"} | |
| ]) |
| from subprocess import check_output | |
| def run_cd(cmd): return check_output(cmd, shell=True).decode('utf-8').split('\n')[:-1] |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| claim=$1 | |
| ns=$2 | |
| pod_name="pvc-inspector" | |
| kubectl get po "$pod_name" -n "$ns" && kubectl delete po "$pod_name" -n "$ns" | |
| cat <<EOF | kubectl apply -f - |
| # Reading file lines from stdin | |
| cat /tmp/test.txt | python -c 'import fileinput; [print(line, end="" for line in fileinput.input()] | |
| python -c 'import fileinput; [print(line, end="") for line in fileinput.input()]' < /tmp/test.txt | |
| # Printing the 3 lines of the file | |
| python -c "import sys; sys.stdout.write(''.join(sys.stdin.readlines()[:3]))" < /tmp/test.txt | |
| # Checking if file exists | |
| python -c 'from pathlib import Path; print("yes") if Path("/tmp/metrics.txt").is_file() else print("no")' |
| #!/bin/bash | |
| # | |
| # Creates a new TypeScript project ready to use with Node.js | |
| set -euo pipefail | |
| if [[ ! -f $(which npm) ]] || [[ ! -f $(which yarn) ]]; then | |
| echo "Please, install npm and yarn before continuing" | |
| echo "See https://docs.npmjs.com/downloading-and-installing-node-js-and-npm" | |
| echo "See https://yarnpkg.com/" | |
| exit |
| # Starting REPL | |
| perl -del | |
| # Search and replace in place | |
| perl -p -i -e "s/test/testing/g" /tmp/testing.txt | |
| # Search/replace in specific files in a directory | |
| perl -p -i -e 's/oldstring/newstring/g' `find ./ -name *.html` | |
| # Similar to awk |
| import java.util.ArrayList | |
| def MAX_TO_KEEP = 10 | |
| def JOB_NAME = "job_name_here" | |
| def hi = hudson.model.Hudson.instance | |
| def item = hi.getItemByFullName(JOB_NAME) | |
| def jobs = item.getAllJobs() | |
| Iterator<?> iterator = jobs.iterator() |