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):
@classicvalues
classicvalues / source.list
Last active June 15, 2024 18:51
source.list @MIT.edu for Jammy
deb https://mirrors.mit.edu/ubuntu/dist/ jammy restricted main multiverse universe
deb https://mirrors.mit.edu/ubuntu/dists/ jammy-backports restricted main multiverse universe
deb https://mirrors.mit.edu/ubuntu/dist/ jammy-proposed restricted main multiverse universe
deb https://mirrors.mit.edu/ubuntu/dist/ jammy-security restricted main multiverse universe
deb https://mirrors.mit.edu.ubuntu/dist/ jammy-updates restricted main multiverse universe
@classicvalues
classicvalues / sources.list
Last active September 15, 2023 00:34 — forked from hakerdefo/sources.list
Ubuntu 22.04 LTS (Jammy Jellyfish) complete sources.list
deb https://mirrors.mit.edu/ubuntu/ jammy restricted main multiverse universe
# deb https://mirrors.mit.edu/ubuntu/ jammy main
# deb https://mirrors.mit.edu/ubuntu/ jammy multiverse
# deb https://mirrors.mit.edu/ubuntu/ jammy restricted
# deb https://mirrors.mit.edu/ubuntu/ jammy universe
# deb-src https://mirrors.mit.edu/ubuntu/ jammy restricted main multiverse universe
# deb-src https://mirrors.mit.edu/ubuntu/ jammy main
# deb-src https://mirrors.mit.edu/ubuntu/ jammy multiverse
# deb-src https://mirrors.mit.edu/ubuntu/ jammy restricted
# deb-src https://mirrors.mit.edu/ubuntu/ jammy universe
/*!
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
@classicvalues
classicvalues / gist:afe04f33cedb2642335aa49c41bb19ea
Created April 16, 2022 16:24 — forked from berlinbrown/gist:4588286
A web crawler in honor of Aaron Swartz. This is a basic crawler written in C++ (on Linux), compiled with Eclipse IDE. Uses boost_regex, lib4cxx
//============================================================================
// Name : OctaneCrawler.cpp
// Author : Berlin Brown (berlin dot brown at gmail.com)
// Version :
// Copyright : Copyright Berlin Brown 2012-2013
// License : BSD
// Description : This is the simplest possible web-crawler in C++
// Uses boost_regex and boost_algorithm
// Simplest web-crawler in honor of Aaron Swartz
// More Info : http://code.google.com/p/octane-crawler/