# apt install privoxy tor
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 json | |
import os | |
import ollama | |
def query_ollama(prompt, model='openhermes:7b-mistral-v2.5-q6_K', context=''): | |
response = ollama.generate( | |
model=model, | |
prompt=context + prompt) | |
return response['response'].strip() |
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
pip install streamlit | |
pip install spacy | |
python -m spacy download en_core_web_sm | |
python -m spacy download en_core_web_md | |
python -m spacy download de_core_news_sm |
- Install to Debian Buster
- All of services needed to run Mastodon instance (tor, postgresql, redis, nginx) will be installed to the same server.
# apt install postgresql redis nodejs npm ruby tor ffmpeg imagemagick git \
nginx wget bundler protobuf-compiler iptables-persistent ncurses-term vim \
gcc g++ make patch ruby-dev libprotobuf-dev libidn11-dev libpq-dev libicu-dev libxml2-dev libxslt1-dev
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 tensorflow as tf | |
import numpy as np | |
import os | |
import gym | |
import time | |
import sklearn | |
import itertools | |
import sklearn.pipeline | |
import sklearn.preprocessing | |
from sklearn.kernel_approximation import RBFSampler |
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
# This example requires CSVkit (https://github.com/wireservice/csvkit). A Python toolset with a lot of very cool CSV tools. | |
# IMPORTANT NOTE: make sure to use a proper csv file. I had a lot of trouble with a csv file created by a service with Dutch | |
# as locale. Changing it to US solved the problem. Some locales use comma's to seperate point numbers. A semicolon is then | |
# used. | |
# Create table example and Load file-a.csv into it | |
csvsql --db sqlite:///example.db --table example --insert file-a.csv | |
# Add an extra file to table example |
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 random | |
# Snakes and Ladders dictionary | |
SaLdic = {6: 17, | |
14: 3, | |
20: 15, | |
24: 26, | |
30: 44, | |
39: 33, | |
49: 62, |
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 Dockerfile that builds PhantomJS 2.0 | |
# | |
# Build with: | |
# docker build --rm --tag=phantom2.0:latest . | |
# | |
# Run with: | |
# docker run --name=phantom2.0 phantom2.0 | |
# | |
# Copy the executable to your host machine for distribution: |
The goal of this is to have an easily-scannable reference for the most common syntax idioms in Ruby and Rust so that programmers most comfortable with Ruby can quickly get through the syntax differences and feel like they could read and write basic Rust programs.
What do you think? Does this meet its goal? If not, why not?
Ruby:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder