Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
bunkering down

John D. Pope johndpope

🏡
bunkering down
View GitHub Profile
View dalle.py
# -*- coding: utf-8 -*-
"""DALL-E Pytorch - COCO dataset
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1KxG1iGBoKt2fLVH7uXG_vhvll2OlFkey
**Install necessary dependencies**
"""
View project_images.py
# from https://github.com/rolux/stylegan2encoder
import argparse
import os
import shutil
import numpy as np
import dnnlib
import dnnlib.tflib as tflib
import pretrained_networks
@johndpope
johndpope / Dockerfile
Last active Dec 19, 2020
tweaks for docker container 3090 nvidia / ssh / zsh
View Dockerfile
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
ARG BASE_IMAGE=nvcr.io/nvidia/tensorflow:20.12-tf1-py3
FROM $BASE_IMAGE
View find_forks.py
import argparse
import json
import subprocess
import urllib.error
import urllib.parse
import urllib.request
def find_forks(remote):
"""
@johndpope
johndpope / GenerateFirebasePushID.SQL
Created Nov 14, 2020 — forked from DimuDesigns/GenerateFirebasePushID.SQL
MySQL Stored Procedure for generating Firebase Push IDs
View GenerateFirebasePushID.SQL
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@johndpope
johndpope / PushIDGenerator.swift
Created Oct 23, 2020 — forked from AhmedOS/PushIDGenerator.swift
Swift 4 port of Firebase Push ID generator
View PushIDGenerator.swift
// original: https://gist.github.com/mikelehen/3596a30bd69384624c11
class PushIDGenerator {
private init() { }
static private let PUSH_CHARS = Array("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
static private var lastPushTime: UInt64 = 0
static private var lastRandChars = Array<Int>(repeating: 0, count: 12)
static func generate() -> String {
View jukebox_extended_notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We couldn’t find that file to show.
View maya - skeleton 3d - arkit
CATALINA (use system python 2 framework / not conda / not pyenv)
install maya trial 2020
Need to install / build the maya plugin
PYTHON 2 - USD is officially supported.
PYTHON 3 - not yet - but nvidia does support.
@johndpope
johndpope / .zprofile
Last active May 7, 2020
gist to split out youtube mp3-> tracks
View .zprofile
export PATH="$HOME/.cargo/bin:$PATH"
mp3(){cd /Users/johndpope/Downloads/spleeter
mv *.mp3 backup
mv output/* backup
youtube-dl $1 --extract-audio --audio-format mp3 -o "%(title)s-%(id)s.%(ext)s"
thefile=$(ls *.mp3)
echo "Splitting file..."
split $thefile