Skip to content

Instantly share code, notes, and snippets.

@wizardbeard
wizardbeard / #ChatGPT Streaming.md
Created December 22, 2023 06:51 — forked from alexrudall/#ChatGPT Streaming.md
ChatGPT streaming with ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind!

How to add ChatGPT streaming to your Ruby on Rails 7 app!

This guide will walk you through adding a ChatGPT-like messaging stream to your Ruby on Rails 7 app using ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind. All code included below!

Alt Text

First, add the ruby-openai gem! Needs to be at least version 4. Add Sidekiq too.

@wizardbeard
wizardbeard / python-3.9-slim.Dockerfile
Last active November 7, 2023 08:22
Build OpenSSL on python:3.9-slim
FROM python:3.9-slim as builder
RUN apt-get update -y && apt-get install -y --no-install-recommends wget make build-essential libssl-dev zlib1g zlib1g-dev
RUN mkdir -p /tmp/python
WORKDIR /tmp/python
RUN wget https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tar.xz
@wizardbeard
wizardbeard / bitcoin_spv_wallet_overview.md
Created September 18, 2022 23:40 — forked from TOMOAKI12345/bitcoin_spv_wallet_overview.md
Bitcoin SPV Wallet Flow Overview

@wizardbeard
wizardbeard / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@wizardbeard
wizardbeard / app.rb
Created January 7, 2014 02:11 — forked from serbrech/app.rb
require "sinatra"
require "mogli"
enable :sessions
set :raise_errors, false
set :show_exceptions, false
# Scope defines what permissions that we are asking the user to grant.
# In this example, we are asking for the ability to publish stories
# about using the app, access to what the user likes, and to be able

Solr server setup on CentOS 6.4

Install packages

yum install java-1.7.0-openjdk tomcat6 tomcat6-webapps tomcat6-admin-webapps wget

Download Solr

wget http://mirror.catn.com/pub/apache/lucene/solr/4.3.1/solr-4.3.1.tgz
tar -xzf solr-*.tgz