Skip to content

Instantly share code, notes, and snippets.

View classicvalues's full-sized avatar
🥇
Automating Python! Working Chatbot @ gemini-chatbot-mocha-three.vercel.app

Classic Values classicvalues

🥇
Automating Python! Working Chatbot @ gemini-chatbot-mocha-three.vercel.app
View GitHub Profile
@classicvalues
classicvalues / Trained_LLM_from_Literature.py
Created July 3, 2024 03:22
A Trained and Fine-Tuned LLM via Publicly Available Literature
import fitz # PyMuPDF
import re
import torch
from torch.utils.data import Dataset, DataLoader
from transformers import AutoTokenizer, AutoModelForCausalLM
from transformers import AdamW
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def extract_text_from_pdf(pdf_path):
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@classicvalues
classicvalues / aircraft_type_fuel_consumption_rate.json
Created July 5, 2023 09:08 — forked from Jxck-S/aircraft_type_fuel_consumption_rate.json
Fuel consumption rates by ICAO type of aircraft
{
"EA50": {
"name": "Eclipse 550",
"galph": 76,
"category": "VLJ"
},
"LJ31": {
"name": "Learjet 31",
"galph": 202,
"category": "Light"
@classicvalues
classicvalues / pg-pong.py
Created October 5, 2022 22:18 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@classicvalues
classicvalues / start-vpn.sh
Created August 28, 2022 02:25 — forked from kordless/start-vpn.sh
VPN Server for Google Cloud
#!/bin/bash
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)
SERVER_NAME=vpn-$NEW_UUID
gcloud compute instances create $SERVER_NAME \
--machine-type "n1-standard-1" \
--image-family ubuntu-1604-lts \
--image-project "ubuntu-os-cloud" \
--boot-disk-size "20" \
--boot-disk-type "pd-ssd" \
--boot-disk-device-name "$NEW_UUID" \
## How to hide API keys from github ##
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while
retaining your commits: https://help.github.com/articles/remove-sensitive-data/
2. In the terminal, create a config.js file and open it up:
touch config.js
atom config.js
@hakerdefo
hakerdefo / sources.list
Last active June 29, 2024 03:19
Ubuntu 22.04 LTS (Jammy Jellyfish) complete sources.list
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
@Jxck-S
Jxck-S / aircraft_type_fuel_consumption_rate.json
Last active July 5, 2023 09:08
Fuel consumption rates by ICAO type of aircraft
{
"EA50": {
"name": "Eclipse 550",
"galph": 76,
"category": "VLJ"
},
"LJ31": {
"name": "Learjet 31",
"galph": 202,
"category": "Light"
@classicvalues
classicvalues / adb.log
Created August 27, 2021 01:12 — forked from Scrxtchy/adb.log
twtich pubsub topics
10-18 15:24:35.608 18746 18927 E twitch-scratch-send: websocket send: wss://pubsub-edge.twitch.tv {"data":{"auth_token":"[REDACTED]", "topics":["user-subscribe-events-v1.90707410"]}, "type":"LISTEN"}
10-18 15:24:35.613 18746 18927 E twitch-scratch-send: websocket send: wss://pubsub-edge.twitch.tv {"data":{"auth_token":"[REDACTED]", "topics":["whispers.90707410"]}, "type":"LISTEN"}
10-18 15:24:35.868 18746 18927 E twitch-scratch-send: websocket send: wss://pubsub-edge.twitch.tv {"data":{"auth_token":"[REDACTED]", "topics":["presence.90707410"]}, "type":"LISTEN"}
10-18 15:24:35.869 18746 18927 E twitch-scratch-send: websocket send: wss://pubsub-edge.twitch.tv {"data":{"auth_token":"[REDACTED]", "topics":["friendship.90707410"]}, "type":"LISTEN"}
10-18 15:24:35.871 18746 18927 E twitch-scratch-send: websocket send: wss://pubsub-edge.twitch.tv {"data":{"auth_token":"[REDACTED]", "topics":["chatrooms-user-v1.90707410"]}, "type":"LISTEN"}
10-18 15:24:37.956 18746 18927 E twitch-scratch-send: webs
@classicvalues
classicvalues / hello_world.rb
Created August 21, 2021 03:54 — forked from therabidbanana/hello_world.rb
An extremely convoluted hello world
#!/usr/bin/env ruby
require 'yaml'
# Prints out the string "Hello World!" in
# an extremely convoluted way involving
# method_missing magic, dynamic method calls,
# some metaprogramming, completely useless comments,
# the DATA block, yaml, and Sesame Street.
#
# This hello world brought to you by the letter Q.