Skip to content

Instantly share code, notes, and snippets.

View lantos1618's full-sized avatar
🐙
yeet

Lantos lantos1618

🐙
yeet
View GitHub Profile
import SwiftUI
import AVFoundation
import Accelerate
import Combine
struct ContentView: View {
@ObservedObject var audioRecorder = AudioRecorder()
@ObservedObject var audioPlayer = AudioPlayer()
import { StyleSheet, Button, View, Text } from 'react-native';
import { useState } from 'react';
import { Audio, Video } from 'expo-av';
export default function App() {
const [sound, setSound] = useState<Audio.Sound | null>();
const [recording, setRecording] = useState<Audio.Recording | null>();
const [permissionResponse, requestPermission] = Audio.usePermissions();
const [uri, setUri] = useState<string | null>(null);
<!DOCTYPE html>
<html>
<head>
<title>Color Frequency Calculator</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
@lantos1618
lantos1618 / generic_k_means.rs
Created April 8, 2024 11:37
an implementation of k_means in wasm
use js_sys::Uint8Array;
use rand::seq::{IteratorRandom, SliceRandom};
use rayon::prelude::*;
use std::sync::{Arc, Mutex};
use wasm_bindgen::prelude::*;
use web_sys::console;
use std::fmt::Debug;
use anyhow::{anyhow, Result};
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
typedef enum {
TAG_HTML,
TAG_HEAD,
TAG_BODY,
TAG_TITLE,
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import pandas as pd
from scipy.signal import argrelextrema
eth = pd.read_csv("./financial_data/eth.csv")
priceData = pd.DataFrame()
// Literal:
// IntLiteral(int),
// FloatLiteral(float),
// BoolLiteral(bool),
// StringLiteral(string)
// Variable:
// name: string
// type: TypeDesc
@lantos1618
lantos1618 / html.zen
Created February 25, 2024 14:04
custom programing language
HtmlTag: enum = {
div = "Div",
p = "P",
h1 = "H1",
h2 = "H2",
}
HtmlNode = {
@lantos1618
lantos1618 / help.rs
Created February 25, 2024 11:04
LLVM Error rust LLVM_SYS not set
for anyone trying to run inkwell via vs code and using the run/debug in rust_analyzer
Setting this in your user settings will fix this
"rust-analyzer.runnables.extraEnv": {
"LLVM_SYS_170_PREFIX": "/opt/homebrew/Cellar/llvm/17.0.6"
}
fn generate_add_func(module: &mut Module) {
let mut func = Function::new(
Linkage::private(),
"add".to_string(),
vec![
(Type::Word, Value::Temporary("a".to_string())),
(Type::Word, Value::Temporary("b".to_string())),
],
Some(Type::Word),