Skip to content

Instantly share code, notes, and snippets.

View soltrinox's full-sized avatar
🤖
Building Cybernetic Systems

Mr. Rosario soltrinox

🤖
Building Cybernetic Systems
View GitHub Profile
@soltrinox
soltrinox / ContentView.swift
Created March 5, 2024 05:30 — forked from otmb/ContentView.swift
WKWebView can read a wasm from a localfile with XMLHttpRequest, but returns an error with fetch
import SwiftUI
import WebKit
enum WebViewError: Error {
case contentConversion(String)
case emptyFileName
case inivalidFilePath
var message: String {
switch self {
@soltrinox
soltrinox / nginx.google.conf
Created January 5, 2024 03:37 — forked from liweitianux/nginx.google.conf
Nginx Proxy to Google
#
# Nginx reverse proxy to Google Search (with images and webcache))
#
# Credit:
# * Nginx rewrite append a parameter at the end of an URL
# https://serverfault.com/a/311660/387898
# * https://github.com/tracycool/Reverse-Proxy-for-Google
# * https://github.com/caiguanhao/nginx-bypass-gfw/blob/master/google.conf
#
# References:
@soltrinox
soltrinox / RecordAudio.swift
Created December 24, 2023 18:51 — forked from leonid-s-usov/RecordAudio.swift
Swift Audio Recording class. Reads buffers of input samples from the microphone using the iOS RemoteIO Audio Unit API
//
// RecordAudio.swift
//
// This is a Swift class (updated for Swift 5)
// that uses the iOS RemoteIO Audio Unit
// to record audio input samples,
// (should be instantiated as a singleton object.)
//
// Created by Ronald Nicholson on 10/21/16.
// Copyright © 2017,2019 HotPaw Productions. All rights reserved.
# Make sure you have Anaconda installed
# This tutorial assumes you have an Nvidia GPU, but you can find the non-GPU version on the Textgen WebUI github
# More information found here: https://github.com/oobabooga/text-generation-webui
conda create -n textgen python=3.10.9
conda activate textgen
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
git clone https://github.com/oobabooga/text-generation-webui
cd text-generation-webui
python -m pip install -r requirements.txt
# this tutorial assumes conda and git are both installed on your computer
conda create -n tg python=3.10.9
conda activate tg
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
git clone https://github.com/oobabooga/text-generation-webui.git
cd text-generation-webui
pip install -r requirements.txt
# GPU only:

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

@soltrinox
soltrinox / nginx-websocket-proxy.conf
Created February 11, 2023 16:04 — forked from uorat/nginx-websocket-proxy.conf
Nginx Reverse Proxy for WebSocket
upstream websocket {
server localhost:3000;
}
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/websocket.access.log main;
from algoliasearch import algoliasearch
import pymongo
from pymongo import MongoClient
import json
client = algoliasearch.Client("Your_Application_ID", 'Your_API_Key')
index = client.init_index('Experiment_1')
MONGODB_URL1 = 'Your_MongoDB_Connection_String'
def move_collection(from_collection):
extension Array {
subscript(circular index: Int) -> Element? {
var i = index
if i < 0 || isEmpty {
return nil
} else if i > count - 1 {
i = index % count
}
return self[i]
}
@soltrinox
soltrinox / ssr_wasm.md
Created May 16, 2022 00:05 — forked from tpmccallum/ssr_wasm.md
How to implements server-side rendering (SSR) using WebAssembly (Wasm)

System

First we update the system (Ubuntu 20)

sudo apt-get update
sudo apt install build-essential
sudo apt-get install npm
npm install svg-url-loader --save-dev
sudo apt install mlocate