Skip to content

Instantly share code, notes, and snippets.

View djstein's full-sized avatar
😬
building https://spice.cloud

Dylan Stein djstein

😬
building https://spice.cloud
View GitHub Profile
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 6.00 GiB total capacity; 5.25 GiB already allocated; 0 bytes free; 5.31 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
@djstein
djstein / gist:6cb4841d4af3b1d7e2e1e22d22f89b8b
Created October 21, 2022 22:05
AWX Source Control Refspec
# since AWX is trash software and they dont fix their own bugs please use this as the Source Control Refspec
# when adding a GitHub Repo to an AWX Project
+refs/heads/*:refs/remotes/origin/*
@djstein
djstein / RainbowKitButton.tsx
Last active May 9, 2022 00:49
RainbowKitWrapper - Full example of using RainbowKit in a NextJS app
import { ConnectButton } from '@rainbow-me/rainbowkit'
const RainbowKitButton = () => {
return (
<ConnectButton.Custom>
{({
account,
chain,
openAccountModal,
openChainModal,
@djstein
djstein / useSubscription.js
Created June 17, 2020 17:59
a useSubscription Hook for Apollo Server when you hate Apollo Client
import { print } from 'graphql/language/printer'
import { useContext, useEffect, useState } from 'react'
export function createWebsocket({ name, uri, token, query, onMessage }) {
if (!uri) {
let subscriptionProtocol = process.env.REACT_APP_API_URL.includes(
'https',
)
? 'wss'
: 'ws'
@djstein
djstein / tesla-cpo-photos.py
Created December 22, 2019 03:09
Tesla CPO Photos Downloader
# Tesla CPO Photos Downloader
# Tired of seeing blurry images of your Tesla CPO order?
# Insert the url your sales rep sent you with the blurry images,
# and have the high resolution versions downloaded to your computer!
#
# Simply run:
# python3 tesla-cpo-photos.py https://backwebs.homenetinc.com/tesla/details/@/your-unique-reference-number/
#
# No dependencies required
# Dylan Stein (djstein@ncsu.edu)
@djstein
djstein / webpack.config.dev.js
Created October 9, 2018 18:18
Create React App 2 Dev Config
'use strict';
const path = require('path');
const webpack = require('webpack');
const PnpWebpackPlugin = require('pnp-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
@djstein
djstein / Simple Django Install
Last active September 25, 2018 19:31
Simple Django Install
!/usr/bin/env bash
# Install Brew and Python3
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew install python3
# Install Python3 Manually
curl https://www.python.org/ftp/python/3.7.0/python-3.7.0-macosx10.9.pkg > python-3.7.0-macosx10.9.pkg
sudo installer -store -pkg python-3.7.0-macosx10.9.pkg -target /