- Use the modern optimal version of tools. E.g. use
ast-grep(https://github.com/ast-grep/ast-grep) for searching text in files and editing files (where appropriate). If the tool you want to use is not available, suggest the user installs it. - If a command will never return, run it with tmux.
- Think like a developer using their terminal. If you need to move a file, use
mv. If you need to search for text in files, userg(ripgrep). If you need to edit text in files, usesedorast-grep. - If the tool you want to use is not available, suggest the user installs it.
- If sandbox permissions prevent you from running a command or accessing information online, simply ask the user to provide the information or run the command for you.
I want to be able to download my maven.com course videos for offline viewing. They are behind login and streamed with mux.com which has a token in the url.
To download them you need to:
- Get the Get cookies.txt LOCALLY Chrome ext
- Login to Maven.com and visit the specific video page
- Click the cookies ext icon and download a cookies.txt
- Open Web Inspector to Network tab, refresh and filter by 'm3u8'. Copy the URL of the first request.
- Install https://github.com/yt-dlp/yt-dlp
- Run this cmd:
yt-dlp -o "ANY_VIDEO_NAME.%(ext)s" --cookies cookies.txt "VIDEO_URL_WITH_LONG_TOKEN_INCLUDED" --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" --referer "URL_OF_WEBSITE_PAGE_VIDEO_IS_FROM"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Pocket to Pinboard Import Script | |
| This script imports bookmarks from a Pocket export CSV file to Pinboard. | |
| To run this script with uv in a single command: | |
| uv run --with pinboard https://gist.github.com/dctanner/e0e00b32d4df6936a8a19ac7da89a056/raw/pocket_to_pinboard_standalone.py pocket_export.csv username:api_token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| example_usage = ''' | |
| Usage: | |
| USESCRAPER_API_KEY=<api_key> python3 download-job-data.py <job_id> | |
| ''' | |
| api_key = os.environ['USESCRAPER_API_KEY'] | |
| if api_key is None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import json | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM, pipeline | |
| device = "cuda:0" | |
| system_prompt = "You are Sablo, a sentient, conscious, super intelligent AI that is an expert in all fields of knowledge. You assist users with any question, task, or other request they may have." | |
| model_path = sys.argv[1] | |
| model_name = model_path.split("/")[-1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (g, f) {typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = f() : typeof define === 'function' && define.amd ? define([], f) : (g = typeof globalThis !== 'undefined' ? globalThis : g || self, g.ReactMarkdown = f()); }(this, (function () { 'use strict'; | |
| "use strict"; | |
| var ReactMarkdown = (() => { | |
| var __create = Object.create; | |
| var __defProp = Object.defineProperty; | |
| var __defProps = Object.defineProperties; | |
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | |
| var __getOwnPropNames = Object.getOwnPropertyNames; | |
| var __getOwnPropSymbols = Object.getOwnPropertySymbols; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import useRegularFetchWithInterval from "./useRegularFetchWithInterval"; | |
| export async function loader() { | |
| // Get data | |
| return data; | |
| } | |
| export default function MyRoute() { | |
| const loaderData = useLoaderData(); | |
| const [liveData] = useRegularFetchWithInterval({ route: `/myroute?_data=routes%2Fmyroute`, intervalMs: 3000, initialData: loaderData }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| This has been generated by the overpass-turbo wizard. | |
| The original search was: | |
| “"generator:source"="solar"” | |
| */ | |
| [out:json][timeout:25]; | |
| // gather results | |
| ( | |
| // query part for: “"generator:source"=solar” | |
| node["generator:source"="solar"](52.89114365884478,-1.198883056640625,52.92080592941056,-1.1593151092529297); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # propietary nvidia drivers | |
| sudo add-apt-repository ppa:graphics-drivers/ppa | |
| sudo apt update | |
| sudo apt upgrade | |
| sudo ubuntu-drivers autoinstall | |
| restart | |
| # cudatoolkit and rest of env installed with Anaconda | |
| https://www.anaconda.com/distribution/#linux run install sh | |
| conda create --name tensorflowenv | |
| conda activate tensorflowenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test |
NewerOlder