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 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): |
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
/*! | |
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. | |
*/ | |
/* |
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
{ | |
"EA50": { | |
"name": "Eclipse 550", | |
"galph": 76, | |
"category": "VLJ" | |
}, | |
"LJ31": { | |
"name": "Learjet 31", | |
"galph": 202, | |
"category": "Light" |
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
""" 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 |
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
#!/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" \ |
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
## 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 |
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
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 |
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
{ | |
"EA50": { | |
"name": "Eclipse 550", | |
"galph": 76, | |
"category": "VLJ" | |
}, | |
"LJ31": { | |
"name": "Learjet 31", | |
"galph": 202, | |
"category": "Light" |
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
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 |
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
#!/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. |
NewerOlder