Skip to content

Instantly share code, notes, and snippets.

@dctanner
dctanner / usescraper_json_download.py
Created March 26, 2024 13:53
Bulk download UseScraper.com Crawler results
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:
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]
(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;
@dctanner
dctanner / myroute.tsx
Created June 29, 2023 12:34
Reload loader data at interval without throwing error on network failure
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 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);
# 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
test
background-color: white;
border: 1px solid;
color: black;
outline: 0;
padding: 8px 7px;
font-size: 0.857em;
height: 35px;
-webkit-appearance: none;
-webkit-box-shadow: 0 1px 2px #DDD inset;
-moz-box-shadow: 0 1px 2px #DDD inset;
;(function(exports, undefined) {
})((typeof exports !== 'undefined' ? exports : this['Thing']));
We couldn’t find that file to show.