Skip to content

Instantly share code, notes, and snippets.

@lukeboi
lukeboi / download_parse_pdf.py
Created December 4, 2024 16:41
Download a PDF and extract all text
# pip install pypdf
import requests
import os
from pypdf import PdfReader
def download_pdf(url):
# Create pdfs directory if it doesn't exist
os.makedirs('pdfs', exist_ok=True)
# Download the PDF file
@lukeboi
lukeboi / segment.py
Created August 29, 2023 06:37
Scroll Auto Segment
import cv2
import numpy as np
from PIL import Image
from skimage.morphology import skeletonize
def fft_high_pass_filter(image, cutoff_frequency):
# Convert the image to grayscale if necessary
if len(image.shape) == 3:
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
@lukeboi
lukeboi / index.html
Created October 11, 2022 04:45
VwxVQBz
<header>
<h2>Luke Farritor</h2>
<p>
<a href="/" name="#top">Blog</a>
<a href="/">About</a>
</p>
</header>
<div id="posts">
<div id="post">
<div id="postinfo">
lukefarritor@LUKEF:~$ source /opt/ros/foxy/setup.sh
lukefarritor@LUKEF:~$ mkdir -p foxy_ws_4
lukefarritor@LUKEF:~$ cd foxy_ws_4
lukefarritor@LUKEF:~/foxy_ws_4$ mkdir src
lukefarritor@LUKEF:~/foxy_ws_4$ cd src
lukefarritor@LUKEF:~/foxy_ws_4/src$ git clone https://github.com/ros-drivers/ros2_ouster_drivers.git
lukefarritor@LUKEF:~/foxy_ws_4/src$ cd ..
lukefarritor@LUKEF:~/foxy_ws_4$ rosdep install --from-paths src --ignore-src -r -y
#All required rosdeps installed successfully
lukefarritor@LUKEF:~/foxy_ws_4$ colcon build
#define encoder0PinA 2
#define encoder0PinB 3
volatile unsigned int encoder0Pos = 0;
void setup() {
//Setup Channel A
pinMode(13, OUTPUT); //Initiates Motor Channel A pin
pinMode(8, OUTPUT); //Initiates Brake Channel A pin
/* Copyright (c) 2015 Qualcomm Technologies Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Qualcomm Technologies Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE