Skip to content

Instantly share code, notes, and snippets.

View kylemcdonald's full-sized avatar

Kyle McDonald kylemcdonald

View GitHub Profile
@kylemcdonald
kylemcdonald / Line Segment Intersection.ipynb
Created July 2, 2019 18:49
Python Line Segment Intersection example.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kylemcdonald
kylemcdonald / Voyager 1 Decode.ipynb
Created August 7, 2015 16:46
Voyager 1 Decoding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kylemcdonald
kylemcdonald / function-calling.ipynb
Created June 14, 2023 01:10
Example of OpenAI function calling API to extract data from LAPD newsroom articles.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kylemcdonald
kylemcdonald / list-compute-engines.sh
Created July 4, 2024 20:17
List all compute engine instances on Google Cloud.
#!/usr/bin/env bash
# List all projects
projects=$(gcloud projects list --format="value(projectId)")
# Function to check if Compute Engine API is enabled
is_compute_api_enabled() {
local project=$1
gcloud services list --enabled --project="$project" --format="value(config.name)" | grep -q "compute.googleapis.com"
}
@kylemcdonald
kylemcdonald / Collect Parler Metadata.ipynb
Last active June 27, 2024 04:09
Collect video URLs and GPS data for Parler videos.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kylemcdonald
kylemcdonald / convert.py
Last active May 25, 2024 19:24
Scrape ShaderToy. Instead of running this, consider downloading the files from here: https://goo.gl/MWGvkL Or if you want to do more work with ShaderToy data, consider using their API https://www.shadertoy.com/api
# !/usr/bin/env python
import os, re, argparse, json
parser = argparse.ArgumentParser(
description='Extract code from ShaderToy json.')
parser.add_argument('input')
parser.add_argument('output')
args = parser.parse_args()
@kylemcdonald
kylemcdonald / Adversarial Variational Bayes toy example.ipynb
Last active May 3, 2024 00:03
Adversarial Variational Bayes toy example in PyTorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kylemcdonald
kylemcdonald / build-caffe.md
Last active March 26, 2024 05:52
How to build Caffe for OS X.

Theory of Building Caffe on OS X

Introduction

Our goal is to run python -c "import caffe" without crashing. For anyone who doesn't spend most of their time with build systems, getting to this point can be extremely difficult on OS X. Instead of providing a list of steps to follow, I'll try to explain why each step happens.

This page has OS X specific install instructions.

I assume:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kylemcdonald
kylemcdonald / _tsne.pdf
Last active February 22, 2024 22:13
Exploring antonyms with word2vec.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.