Skip to content

Instantly share code, notes, and snippets.

View eturkes's full-sized avatar

Emir Turkes eturkes

View GitHub Profile
@eloylp
eloylp / Fedora35Hibernation.md
Last active April 25, 2024 07:40
Fedora 35 hibernation with swapfile, only for hibernation and resume

Fedora35 hibernation

This guide helps to configure the hibernation on a default Fedora35 (also worked fine in previous Fedora34) installation by using a swap file. The Fedora35 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
@jmuhlich
jmuhlich / ometiff-channel-names.py
Created April 22, 2020 21:42
ometiff-channel-names.py
import sys
import io
import warnings
import xml.etree.ElementTree
import tifffile
if len(sys.argv) != 2:
print(f"Usage: ometiff-channel-names.py input.ome.tif")
print("Print the channel names for the first image in an OME-TIFF file.")
sys.exit(1)
#!/bin/sh
echo "# 24-bit (true-color)"
# based on: https://gist.github.com/XVilka/8346728
term_cols="$(tput cols || echo 80)"
cols=$(echo "2^((l($term_cols)/l(2))-1)" | bc -l 2> /dev/null)
rows=$(( cols / 2 ))
awk -v cols="$cols" -v rows="$rows" 'BEGIN{
s=" ";
m=cols+rows;
#!/bin/bash
# Clone all github.com repositories for a specified user.
if [ $# -eq 0 ]
then
echo "Usage: $0 <user_name> "
exit;
fi
@johnhw
johnhw / umap_sparse.py
Last active January 6, 2024 16:09
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@supposedly
supposedly / arg-parsers.md
Last active December 16, 2021 09:53
This list is probably out of date. It hasn't been updated since September 2019.

Big ol' list of third-party Python 3 argparse alternatives

Bold+italics means the lib is probably worth checking out above the rest. joffrey is my own.

argparse wrappers

@max-mapper
max-mapper / data.csv
Last active January 9, 2019 16:31
eLife dataset DOIs (specifically linked as 'external datasets' from the paper, most of which live in external repositories)
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 4 columns, instead of 3. in line 9.
doi,id,type,url
10.7554/eLife.00007,dataro1,generated-dataset,http://dx.doi.org/10.5061/dryad.gs45f
10.7554/eLife.00048,dataro1,generated-dataset,http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE40298
10.7554/eLife.00049,dataro1,generated-dataset,http://www.ncbi.nlm.nih.gov/genbank/
10.7554/eLife.00065,dataro1,generated-dataset,http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE39313http://www.ncbi.nlm.nih.gov/geo/
10.7554/eLife.00170,dataro1,generated-dataset,http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE41937http://eisenlab.org/data/TAF7Lhttp://www.ncbi.nlm.nih.gov/geo/
10.7554/eLife.00170,dataro2,generated-dataset,http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE21365http://www.ncbi.nlm.nih.gov/geo/
10.7554/eLife.00170,dataro3,generated-dataset,http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE27450http://www.ncbi.nlm.nih.gov/geo/
10.7554/eLife.00170,dataro4,generated-dataset,http://trace.ddbj.nig.ac.jp/DRASearch/study?acc=DRP000383http://www.ddbj.nig.ac.jp/
10.7554/eLife.00184,dataro1,
@Spindel
Spindel / model.py
Last active March 22, 2023 01:19
Interview question model.
import uuid
import random
from afase.models.meta import Base
from sqlalchemy import (
Column,
Text,
Date,
ForeignKey,
library(XLConnect)
library(magrittr)
library(dplyr)
# mouse rna seq data download Zeisel et al. download------
dir.create('data-raw/ZeiselMouse', showWarnings=FALSE)
download.file(url= 'http://storage.googleapis.com/linnarsson-lab-www-blobs/blobs/cortex/expression_mRNA_17-Aug-2014.txt',
destfile='data-raw/ZeiselMouse/mouseRNASeq_Zeisel 2015.txt')
download.file(url = 'http://science.sciencemag.org/highwire/filestream/628248/field_highwire_adjunct_files/1/aaa1934_TableS1.xlsx',
destfile = 'data-raw/ZeiselMouse/markerGenes.xlsx')
@gene1wood
gene1wood / analyze_pypi_package_names.py
Last active June 12, 2023 02:24
Analysis of PyPi package names and the use of dashes underscores upper and lower case
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
packages = client.list_packages()
total = len(packages)
dashes = len([x for x in packages if '-' in x])