The content which was previous linked to by the link you clicked has been removed for quality control reasons. Sorry! On the plus side, you didn't waste your time reading something that wasn't actually very good :-)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'http' | |
require 'json' | |
class GroqClient | |
def initialize(api_key: nil, api_url: "https://api.groq.com/openai/v1/chat/completions", model: "mixtral-8x7b-32768") | |
@api_key = api_key || ENV['GROQ_API_KEY'] | |
@api_url = api_url | |
@model = model | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- A totally pointless and overkill use of import maps | |
and Moment.js, in order to simply use the technology and | |
see it in action.. --> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Buildless example</title> | |
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of using SQLite VSS with OpenAI's text embedding API | |
# from Ruby. | |
# Note: Install/bundle the sqlite3, sqlite_vss, and ruby-openai gems first | |
# OPENAI_API_KEY must also be set in the environment | |
# Other embeddings can be used, but this is the easiest for a quick demo | |
# More on the topic at | |
# https://observablehq.com/@asg017/introducing-sqlite-vss | |
# https://observablehq.com/@asg017/making-sqlite-extension-gem-installable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Perceptron | |
def initialize(inputs, bias = 0.0) | |
@weights = Array.new(inputs.keys.first.size) { rand } | |
@inputs = inputs | |
@bias = bias | |
end | |
def run(inputs) | |
z = inputs.zip(@weights).map { |i, w| i * w }.reduce(:+) + @bias | |
1.0 / (1.0 + Math.exp(-z)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'rest-client' | |
require 'base64' | |
url = "http://localhost:7860" | |
payload = { | |
"prompt": "liminal space, unusual lighting, sinister presence", | |
"negative_prompt": "", | |
"steps": 30, | |
"sampler_name": "Euler a", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read stdin, extract email addresses | |
# Look up MX records for those addresses | |
# Return each email address and their first MX record | |
# (or IP address, as a fallback) | |
hosts = {} | |
STDIN.each_line do |l| | |
# Extract the email and the email domain from each line | |
email = l[/^([^\s]+\@[^\s+\,]+)\b/, 1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
# Initialize variables | |
api_url = "https://meta.wikimedia.org/w/api.php" | |
params = { | |
"action": "query", | |
"format": "json", | |
"list": "globalblocks", | |
"bglimit": "500" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# finds songs by names listed in a text file | |
# and adds them to a spotify playlist | |
import pprint | |
import re | |
import spotipy | |
from spotipy.oauth2 import SpotifyOAuth | |
from iteration_utilities import grouper | |
playlist = ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ufw insert 1 deny from 2.59.50.0/24 to any | |
ufw insert 1 deny from 5.183.130.0/24 to any | |
ufw insert 1 deny from 31.40.203.0/24 to any | |
ufw insert 1 deny from 45.11.20.0/23 to any | |
ufw insert 1 deny from 45.11.20.0/24 to any | |
ufw insert 1 deny from 45.11.21.0/24 to any | |
ufw insert 1 deny from 45.15.72.0/23 to any | |
ufw insert 1 deny from 45.15.72.0/24 to any | |
ufw insert 1 deny from 45.15.73.0/24 to any | |
ufw insert 1 deny from 45.15.236.0/23 to any |
NewerOlder