Skip to content

Instantly share code, notes, and snippets.

View loftwah's full-sized avatar
💭
“Any sufficiently advanced technology is equivalent to magic.”

Dean Lofts loftwah

💭
“Any sufficiently advanced technology is equivalent to magic.”
View GitHub Profile
@alexrudall
alexrudall / #ChatGPT Streaming.md
Last active April 29, 2024 00:26
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.

@gptkrsh
gptkrsh / readme.md
Created January 14, 2023 04:09
Hubber API Design

API Design

API

This is a draft on how we can design the API for EddieHubCommunity/LinkFree.

LinkFree consists of 4 main data models:

  1. User Profile
  2. User Link
@rssws
rssws / install-k8s-flannel-debian+ubuntu.bash
Last active November 9, 2023 06:22
Install k8s + flannel on debian / ubuntu for master / worker node
install_docker () {
distro=$(cat /etc/*-release | grep DISTRIB_ID | awk -F '=' '{print $2}' | awk '{print tolower($0)}')
distroList=("debian" "ubuntu")
if [[ -n "${distro}" ]]; then
if [[ " ${distroList[*]} " =~ " ${distro} " ]]; then
echo "Installing kubernetes on $distro"
else
echo "Upsupported system distro: ${distro}"
echo "<distro> must be one of: ${distroList[*]}"
@taskylizard
taskylizard / fmhy.md
Last active May 2, 2024 04:58
/r/freemediaheckyeah, in one single file (view raw)
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active April 26, 2024 07:30
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
// ==UserScript==
// @name GitHub - Header Sticky On Top
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Vic P. @ https://vic.onl/
// @match https://github.com
// @match https://github.com/*/*
// @match https://gist.github.com/*
// @exclude https://gist.github.com/*/*
@raghavmri
raghavmri / main.py
Created December 5, 2021 09:00
youtube_downloader_python
# importing the module
from pytube import YouTube, Playlist
from pathlib import Path
import os
# Global variables
file_size = 0
def main():
@jpuris
jpuris / counting_words.ipynb
Last active December 5, 2021 18:06
Word frequency in text with counters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tshemsedinov
tshemsedinov / notOptimal.js
Last active December 8, 2021 08:59
Bad code example for students
'use strict';
let movePoints = (offset, points) => {
points.forEach((point) => {
const type = typeof point;
if (type === 'object') {
point.x += offset.x;
point.y += offset.y;
} else {
let i = points.indexOf(point);
@wangvnn
wangvnn / tools-engineer-checklist.md
Created November 29, 2021 05:54 — forked from gorlak/tools-engineer-checklist.md
Tools Engineer Checklist

This list is provided as a guide for tools engineers of all skill levels looking for jobs in the game industry. It's meant as a guide to topics that should be pursued broadly in order to be well spoken in an interview. I doubt any hiring manager requires deep knowedge across every topic, but an ideal candidate would be somewhat knowledgable (aware of its existence if asked directly) with all topics here.

Each list of bullets increases in difficulty, so later bullets are more applicable to senior (or even director) level candidates.

Good luck.

@gorlak

Math