Skip to content

Instantly share code, notes, and snippets.

View johndpope's full-sized avatar

John D. Pope johndpope

View GitHub Profile
# -*- 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**
"""
# 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 December 19, 2020 22:48
tweaks for docker container 3090 nvidia / ssh / zsh
# 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
@johndpope
johndpope / find_forks.py
Created December 14, 2020 22:54
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 November 14, 2020 10:29 — forked from DimuDesigns/GenerateFirebasePushID.SQL
MySQL Stored Procedure for generating Firebase Push IDs
/**
* 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 October 23, 2020 19:57 — forked from AhmedOS/PushIDGenerator.swift
Swift 4 port of Firebase Push ID generator
// 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 {
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.
@johndpope
johndpope / maya - skeleton 3d - arkit
Last active May 18, 2020 05:42
loading skeletons
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 23:22
gist to split out youtube mp3-> tracks
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