Skip to content

Instantly share code, notes, and snippets.

View Yumshot's full-sized avatar
🏠
Working from home

Yumshot Yumshot

🏠
Working from home
View GitHub Profile
main.rs
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
Human Command Actual Command Arguments Description
Google Search "google" args: "input": "<search>" Searches Google for the specified <search> term.
Browse Website "browse_website" args: "url": "<url>", "question": "<what_you_want_to_find_on_website>" Navigates to the specified <url> and looks for the specified <what_you_want_to_find_on_website>.
Start GPT Agent "start_agent" args: "name": "<name>", "task": "<short_task_desc>", "prompt": "<prompt>" Starts a new GPT (Generative Pre-trained Transformer) agent with the specified <name>, <short_task_desc>, and <prompt>.
Message GPT Agent "message_agent" args: "key": "<key>", "message": "<message>" Sends the specified <message> to the GPT agent with the specified <key>.
List GPT Agents "list_agents" args:
export function drawSquareGridPattern(ctx: CanvasRenderingContext2D, width: number, height: number) {
// Generate a random set of points
const numPoints = Math.floor(Math.random() * 20) + 10;
const points = range(numPoints).map(() => [Math.random() * width, Math.random() * height] as [number, number]);
// Create a Voronoi diagram from the points
const voronoiDiagram = voronoi().extent([[0, 0], [width, height]])(points);
// Find the four outermost edges of the Voronoi diagram
let topEdge: any, bottomEdge: any, leftEdge: any, rightEdge: any;
export function drawRandomRoadPattern(ctx: CanvasRenderingContext2D, width: number, height: number) {
// Generate a random set of points
const numPoints = Math.floor(Math.random() * 20) + 10;
const points = range(numPoints).map(() => [Math.random() * width, Math.random() * height] as [number, number]);
// Create a Voronoi diagram from the points
const voronoiDiagram = voronoi().extent([[0, 0], [width, height]])(points);
// Draw the Voronoi diagram
ctx.strokeStyle = "white";
const canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')!
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d");
export function drawBoundingBox() {
if (!ctx) return;
const side = Math.min(canvas.width, canvas.height);
const centerX = canvas.width / 2;
const centerY = canvas.height / 2;
const radius = side / 2;
import './style.css';
const canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')!
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d");
const pointsWanted = 10;
export function drawBoundingBox() {
if (!ctx) return;
const side = Math.min(canvas.width, canvas.height);
import { Delaunay } from 'd3-delaunay';
import './style.css';
const canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')!
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d");
const pointsWanted = 5;
let points: ArrayLike<[number, number]> | Iterable<[number, number]> | any = [];
export function drawBoundingBox() {
if (!ctx) return;
import { range } from 'd3';
import { voronoi } from 'd3-voronoi';
import './style.css';
const canvas = document.querySelector<HTMLCanvasElement>('#myCanvas')!
const refreshButton = document.querySelector<HTMLButtonElement>('#draw-road-button')!
const ctx: CanvasRenderingContext2D | null = canvas.getContext("2d");
let points: ArrayLike<[number, number]> | any = [];
let octagonPoints: any = [];
let isShowing = false;
@Yumshot
Yumshot / gist:ddec764b689e11402715c8f0c4e6edc4
Created May 2, 2022 16:27
Dynamic Support & Resistance : TradingView
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo
//@version = 4
study(title=" Support and Resistance Levels with Breaks",shorttitle = " Support and Resistance Levels with Breaks", overlay = true , max_bars_back=1000)
//
toggleBreaks = input(true, title = "Show Breaks" )
leftBars = input(15, title = "Left Bars ")
rightBars = input(15, title = "Right Bars")
volumeThresh = input(20, title = "Volume Threshold")
@Yumshot
Yumshot / .ts
Created April 29, 2022 02:36
???
import { AxiosInstance } from 'axios';
import { SubmitTokenResponse } from './types';
declare class TDAmeritrade {
CONSUMER_KEY: string;
client: AxiosInstance;
refreshToken: string | undefined;
constructor(consumerKey: string);
submitAuthToken(token: string, offline: boolean, redirectUri: string): Promise<SubmitTokenResponse>;
getNewAccessToken(): Promise<SubmitTokenResponse>;
getOauthLink(redirectUri: string): string;