Skip to content

Instantly share code, notes, and snippets.

View CharStiles's full-sized avatar

Char CharStiles

View GitHub Profile
@siliconjungle
siliconjungle / vector-db.js
Created October 15, 2023 21:59
Simple vector db embeddings.
import readline from 'readline'
import chalk from 'chalk'
import OpenAI from 'openai'
import { LocalIndex } from 'vectra'
import { fileURLToPath } from 'url'
import path, { dirname } from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
@skullface
skullface / the_force_2020_5M_23D_19H_49m_32s.frag
Created May 24, 2020 01:36
what i ended up with from today’s shader workshop!
// giant circle owo
float circ(vec2 p) {
return length(p - 0.9) - 0.1;
}
// cycle thru color via cosine function
vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d ) {
return a + b*cos( 6.28318*(c*t+d) );
}
@solsarratea
solsarratea / fractals.glsl
Created March 27, 2020 17:26
Raymarching Mandelbulb in Kodelife
uniform float time;
uniform vec2 resolution;
uniform vec3 spectrum;
uniform sampler2D texture0;
out vec4 fragColor;
#define PHI (sqrt(5)*0.5 + 0.5)
//Color function
vec3 palette( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d )
{
function chat() {
buttons = document
.querySelectorAll('.conversations-quick-replies__reply button');
if (buttons) {
var idx = Math.floor(Math.random() * Math.floor(buttons.length));
buttons[idx].click();
}
}
function startChat(interval) {
@brannondorsey
brannondorsey / chattervox_install_macos.md
Last active February 22, 2023 21:02
Chattervox Install Instructions

Chattervox on MacOS

Install Direwolf

The official Direwolf User Manual uses MacPorts to manage installation and dependencies. I don't particularly like MacPorts, so here are some instructions for installing Direwolf via Homebrew.

# Install Direwolf via Homebrew
brew install tdsmith/ham/direwolf
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# You can run this module directly with:
# twistd -ny emailserver.tac
"""
A toy email server.
"""
from functools import partial
@sephirot47
sephirot47 / GLSL Raymarch ShaderToy tutorial and example code
Created June 29, 2015 12:28
GLSL Raymarch ShaderToy tutorial and example code
/*
a shader executes per pixel
so every thing you see here is he function for every pixel
raymarching is in principe a function that finds the closest point to any surface in the world
then we move our point by that distance and use the same function,
the function will probably be closer to an object in the world every time
and after about 40 to 200 iterations you'll either have found an object or
missed them all into infinity
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active November 16, 2024 05:51
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@danopia
danopia / index.html
Created April 20, 2013 06:12
nodejs collaborative editor, requires socket.io
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>collab editing, yo</title>
<link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
<link rel="stylesheet" href="http://codemirror.net/theme/ambiance.css">
<script src="http://codemirror.net/lib/codemirror.js"></script>
<script src="http://codemirror.net/addon/mode/overlay.js"></script>
<script src="http://codemirror.net/mode/xml/xml.js"></script>
@fieldOfView
fieldOfView / WebGL360Video.html
Created March 7, 2013 07:57
Simple WebGL/GLSL video panorama viewer
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Simple WebGL/GLSL video panorama viewer</title>
<style>
body {
background-color: #000000;