Skip to content

Instantly share code, notes, and snippets.

View blake41's full-sized avatar

Blake Johnson blake41

  • http://blakejohnson.brandyourself.com/
View GitHub Profile
Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.Understand this error
206Unchecked runtime.lastError: The message port closed before a response was received.Understand this error
background.js:80 [OP] Locked at Tue Jul 22 2025 12:35:30 GMT-0400 (Eastern Daylight Time)
background.js:80 Received <LockStateChanged> from the native core
background.js:80 [OP] Locked at Tue Jul 22 2025 12:39:31 GMT-0400 (Eastern Daylight Time)
15background.js:80 DeviceHandler: DeviceTrust is not available - aborting
(anonymous) @ background.js:80Understand this warning
background.js:80 Received <LockStateChanged> from the native core
background.js:80 [OP] Locked at Tue Jul 22 2025 14:05:37 GMT-0400 (Eastern Daylight Time)
18background.js:80 DeviceHandler: DeviceTrust is not available - aborting
@blake41
blake41 / dspy.py
Created June 26, 2025 17:17
dspy.py
from pathlib import Path
from typing import Literal, Optional
import os, random, dspy
from datetime import datetime
from dspy.teleprompt import MIPROv2
from dspy.evaluate import Evaluate
import mlflow
from data_processor import QualificationDataProcessor, load_processed_dataset
{
"steps": [
{
"stage": "2. Qualified",
"requiredFields": [
{
"name": "Need__c",
"label": "Need",
"type": "picklist"
}
import { Injectable, OnModuleInit } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { generateText, generateObject, NoObjectGeneratedError } from 'ai';
import { createPortkey } from '@portkey-ai/vercel-provider';
import { anthropic } from '@ai-sdk/anthropic';
import { ApiRequestException } from '../common/errors/api.request.exception';
import { z } from 'zod';
@Injectable()
export class AIService implements OnModuleInit {
async function connect() {
// Initializing connection to the NEAR node.
window.near = await nearAPI.connect(Object.assign(nearConfig, { deps: { keyStore: new nearAPI.keyStores.BrowserLocalStorageKeyStore() }}));
// Needed to access wallet login
window.walletAccount = new nearAPI.WalletConnection(window.near);
// Initializing our contract APIs by contract name and configuration.
window.contract = await near.loadContract(nearConfig.contractName, {
viewMethods: ['getCounter'],
LivepeerSDK({provider: 'https://rinkeby.infura.io'}).then(async (sdk) => {
// Once initialized, you can access the methods under the `rpc` namespace
const { rpc } = sdk
// For example, you can get the total supply of Livepeer Tokens like so
const jobs = await rpc.getJobs({broadcaster: '0xa452a1824ac4609Ab93d8b8a442b04847a6Aee01'})
console.log(jobs[0])
})
<html>
<head>
<link rel='stylesheet' href="styles.css" type='text/css'>
</head>
<video controls id="network-video" style="margin-top: 20px" autoplay="" src="http://169.254.95.170:8935/stream/1220b0336cf5c3c34c0a05e5f8d9a6fb8874a091ff47a9546cf748d8e93827b005010bead94a9e2459193bcba1ba726ba331f1c20cf6558d3c129e4e5ec2967f388d.m3u8"></video>
</html>
var canvas = document.getElementById("canvas")
var dataURL = canvas.toDataURL()
// i then display this dataURL doing this
<img src="dataURL">
// this works fine
// then i grab that same data and do
import Web3 from 'web3';
const web3 = new Web3(window.web3.currentProvider);
export default web3;
{
"links": {
"self": "https:\/\/api.stg.dowjones.com\/content\/refs\/drn:archive.webpage.WC93177020170807ed87001p5?article_format=FullArticle"
},
"data": {
"type": "Content",
"id": "WC93177020170807ed87001p5",
"links": {
"redirect": "https:\/\/api.stg.dowjones.com\/content\/refs\/drn:archive.webpage.WC93177020170807ed87001p5\/redirect"
},