Skip to content

Instantly share code, notes, and snippets.

View AdamStormhardtGH's full-sized avatar

Adam AdamStormhardtGH

View GitHub Profile
@AdamStormhardtGH
AdamStormhardtGH / image_to_psd_layer.py
Created January 5, 2024 02:33
Using python to write a new layer to a psd file
"""
Exmample of how to read a PSD in python, add a layer and write image data to it.
With this you can automate a bunch of PSD functionality
"""
import pytoshop
from pytoshop import layers
from pytoshop.enums import BlendMode
import numpy as np
@AdamStormhardtGH
AdamStormhardtGH / gist:7611465825b421a294ff07a7e9c6af10
Created August 29, 2021 05:41
torch.cuda.is_available() false on windows - fix
https://github.com/pytorch/pytorch/issues/50032
erolrecep commented on Jul 23
I had the same issue.
CUDA: 11.2
Nvidia-driver: 460.91.03
GPU model: RTX 2080 Ti
Ubuntu 20.04
Python 3.8 with virtualenv
@AdamStormhardtGH
AdamStormhardtGH / install_anaconda.md
Created August 29, 2021 02:25 — forked from kauffmanes/install_anaconda.md
Install Anaconda on Windows Subsystem for Linux (WSL)

Note: $ denotes the start of a command. Don't actually type this.

Edit: This article is also on my blog: https://www.emilykauffman.com/teaching/install-anaconda-on-wsl

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose Anaconda3-5.2.0-Linux-x86_64.sh.
  4. From the terminal run wget https://repo.continuum.io/archive/[YOUR VERSION]. Example: $ wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
  5. Run the installatio
@AdamStormhardtGH
AdamStormhardtGH / gist:2a41276492d1563e27fc38d4d4fb304e
Created May 4, 2020 01:30
JQL Show stories where epic link is assocaited with an initiative
//For Jira Cloud, use JQL to show stories where epic link is assocaited with an initiative
"Epic Link" in linkedIssues("<initiative id>")
@AdamStormhardtGH
AdamStormhardtGH / gist:204a5207d9453b60d5b2a91eb6251b6c
Created May 4, 2020 01:30
JQL Show stories where epic link is assocaited with an initiative
//For Jira Cloud, use JQL to show stories where epic link is assocaited with an initiative
"Epic Link" in linkedIssues("<initiative id>")
select 'GRANT SELECT ON ALL TABLES IN SCHEMA ' || nspname || ' TO GROUP READONLY; GRANT USAGE ON SCHEMA ' || nspname || ' TO GROUP READONLY;'
from pg_namespace
where nspowner = 100;
### from all over the net - doom9.org etc
# https://forum.doom9.org/showthread.php?p=1885049#post1885049
ffmpeg -i "park_joy_1080p50.y4m" -f yuv4mpegpipe -strict -1 - | nvencc64 -c hevc --vbrhq 0 --vbr-quality 31 -u quality --output-depth 10 --lookahead 32 -b 5 --ref 7 --nonrefp --aq --aq-temporal --bref-mode middle --mv-precision q-pel -i - -o "park_joy_1080p50_31.mkv"
ffmpeg -i "park_joy_2160p50.y4m" -f yuv4mpegpipe -strict -1 - | nvencc64 -c hevc --vbrhq 0 --vbr-quality 40.5 -u quality --output-depth 10 --lookahead 32 -b 5 --ref 7 --nonrefp --aq --aq-temporal --bref-mode middle --mv-precision q-pel -i - -o "park_joy_2160p50_40.5.mkv"
x264 "park_joy_1080p50.y4m" --preset veryslow --tune film --pass 1 --bitrate 10000 -o "park_joy_1080p50_x264.264"
x264 "park_joy_1080p50.y4m" --preset veryslow --tune film --pass 2 --bitrate 10000 -o "park_joy_1080p50_x264.264"
# https://forum.doom9.org/showthread.php?p=1885293#post1885293
Test:
------------------------------------------------------
-- get a list of users and their max site role
------------------------------------------------------
Select
su.name
, -- site role id should be max here
sr.id,
sr.display_name,
sr.licensing_rank,
@AdamStormhardtGH
AdamStormhardtGH / readJSON.jsx
Created September 2, 2018 02:04
After Effects Extendscript Read JSON
//from https://github.com/fabianmoronzirfas/extendscript/wiki/Read-In-JSON-From-File-And-DONT-Eval
//For after effects Extendscript
//This function returns the json object for you to parse as needed
//usage:
// assume data.json looks like this: { "Cat":{"power":2, "affection": 4, "default_name":"Bagel"}}
// var myjson = getJSON("data.json");
// var cat_power = myjson.cat.power