Skip to content

Instantly share code, notes, and snippets.

View jaybo's full-sized avatar

Jay Borseth jaybo

View GitHub Profile
@woodbri
woodbri / get-wind.py
Last active March 4, 2024 14:54
Python script to fetch GFS wind data and create a JSON file
#!/usr/bin/env python3
'''
get-winds.py
- get the latest data from nomads.ncep.noaa.gov unless we have it already
- generate file /maps/wms/data/windy.json
- generate windy.latest file with time stamp
'''
@d1ff
d1ff / pytorch_opencv_interop.cpp
Created May 21, 2017 13:32
Minimal example of processing PyTorch tensors in C++ with cv::cuda::GpuMat
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/python.hpp>
#include <opencv2/cudaarithm.hpp>
#include <opencv2/cudaimgproc.hpp>
#include "pytorch_cpp_interop.h"
namespace py = boost::python;
@acdha
acdha / simple_cors_server.py
Last active May 3, 2024 22:08
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')