Skip to content

Instantly share code, notes, and snippets.

View gdevenyi's full-sized avatar

Gabriel A. Devenyi gdevenyi

View GitHub Profile
@yku12cn
yku12cn / image_widget.py
Last active May 23, 2022 22:15 — forked from ssokolow/image_widget.py
PyQt 5.x code for Just Do What I Mean™ image display in the presence of animated GIFs and containers with no fixed aspect ratio
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Example code for a PyQt image-display widget which Just Works™
TODO: Split this into a loader wrapper and a widget wrapper so it can be used
in designs which maintain a preloaded queue of upcoming images to improve
the perception of quick load times.
reworke adaptScale() so they have the same type signature.
Note from HeleleMama:
@lawrenceching
lawrenceching / install-frp-as-systemd-service.sh
Last active June 3, 2026 01:32
Install frp as systemd service
#!/bin/bash
# Update on 2024/05/29
# 1. use wget to fetch latest frp version when curl was not installed
# 2. Remind users that frp will be run in non-root user
# 3. Add CI
#
# Update on 2024/04/13
# 1. Improved OS compatibility: try wget and then curl for downloading files.
#
# Update on 2024/01/26
@wkrea
wkrea / textlive-full-beefless.md
Created September 2, 2020 13:30 — forked from shivams/textlive-full-beefless.md
`texlive-full` without the beef

TLDR;

On an Debian/Ubuntu-based system, to install texlive-full without docs and language packs, simply do this:

sudo apt install `sudo apt --assume-no install texlive-full | \
		awk '/The following additional packages will be installed/{f=1;next} /Suggested packages/{f=0} f' | \
		tr ' ' '\n' | grep -vP 'doc$' | grep -vP 'texlive-lang' | grep -vP 'latex-cjk' | tr '\n' ' '`

After this, if you wish to install the language packs, selectively install them. E.g.:

@amcdavid
amcdavid / .Rprofile
Last active August 1, 2024 19:58
Load environment modules (https://modules.readthedocs.io/en/latest/index.html) after R is started
local({
# modify as needed
modules = c("git", "git-lfs", "gcc")
capt = system2("./capture_module_environment.sh", modules, stdout = TRUE)
split = strsplit(capt, '=', fixed = TRUE)
out = lapply(split, function(v){
do.call(Sys.setenv, stats::setNames(list(v[2]), v[1]))
})
message("Added environment variables for ", paste(modules, collapse = ', '))
})
@denji
denji / nvenc-install.sh
Last active August 24, 2025 10:53 — forked from lucaspar/nvenc-install.sh
Installation script of CUDA-accelerated `ffmpeg` with NVIDIA Encoder ( docker NVIDIA Encoder https://github.com/markus-perl/ffmpeg-build-script )
#!/bin/bash
# =========================================================================
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817
# =========================================================================
# This script will compile and install a static FFmpeg build with
# support for NVENC in Ubuntu. Updated for Ubuntu 24.04.2,
# with NVIDIA Drivers v535.183.01 and CUDA v12.2 with a GPU
# with CUDA capability 8.6 (RTX 3080). Set ccap below if using
# a different GPU.
# It assumes NVIDIA drivers are installed and that you have a
#! /bin/bash
## See also https://github.com/nextflow-io/nextflow/discussions/4308
## cd to a parent directory for a Nextflow pipeline executation, i.e. contains .nextflow and work directories
## Find work directories essential to the last pipeline run, as absolute paths
nextflow log last > /tmp/preserve_dirs.txt
## Find all work directories, as absolute paths
@benkay86
benkay86 / volume_space_conversion.md
Created March 14, 2024 02:31
convert a cifti dense label (dlabel) file to a different volume space

Volume Space Conversion

The Problem

A collaborator shares some fMRI data with you in a file called other.dtseries.nii. You try to parcellate the data and get this error:

wb_command -cifti-parcellate \
  other.dtseries.nii \
  parcellation.dlabel.nii \