Skip to content

Instantly share code, notes, and snippets.

View lbergelson's full-sized avatar
💭
🐳

Louis Bergelson lbergelson

💭
🐳
View GitHub Profile
@lbergelson
lbergelson / test_for_intel_tensor_flow.py
Created April 23, 2020 21:21
Snippet to detect intel tensor flow.
print("TensorFlow version: {}".format(tf.__version__))
print("Intel MKL-DNN is enabled = {}".format(tf.pywrap_tensorflow.IsMklEnabled()))
@lbergelson
lbergelson / remove-terra-banner.js
Created October 31, 2019 18:39
shrink terra forum search banner
// ==UserScript==
// @name Remove terra support header image
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove the large header image on the terra support page and move the search bar to the nav bar.
// @author You
// @match https://support.terra.bio/*
// @grant none
// ==/UserScript==
@lbergelson
lbergelson / commands.sh
Created January 23, 2019 18:27
reducing docker size commands
#get largest files / folders in the file system
du -h | sort -hr | head
#sum sizes of specific files
find . -name "*.pyc" -print0 | du -hc --files0-from=- | tail
#delete those same ones
find . -name "*.pyc" -exec rm {} \;
@lbergelson
lbergelson / git-recent
Last active November 8, 2018 18:10 — forked from jordan-brough/git-recent
Git: Display a list of recently checked out branches/tags/commits
#!/usr/bin/env bash
# Source: https://gist.github.com/jordan-brough/48e2803c0ffa6dc2e0bd
# Download this script as "git-recent" (no extension), chmod it to be executable and put it in your
# path somewhere (e.g. /usr/bin). You can then use it via `git recent` from inside any git repo.
# Example:
#
# $ git recent -n 5
@lbergelson
lbergelson / build.gradle
Last active April 17, 2018 15:28
shadow 2.0.3 issue build.gradle
//Note: this section 'buildscript` is only for the dependencies of the buildscript itself.
// See the second 'repositories' section below for the actual dependencies of GATK itself
buildscript {
repositories {
mavenCentral()
jcenter() // for shadow plugin
}
}
local ret_status="%(?:%{$fg_bold[green]%}🐋 :%{$fg_bold[red]%}🐳 %s)"
PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@lbergelson
lbergelson / build.gradle
Created July 14, 2016 21:01
build.gradle with no grgit
import javax.tools.ToolProvider
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id "java"
@lbergelson
lbergelson / zipMap.java
Created September 11, 2015 18:14
produce a lazy iterator by mapping a biFunction to two iterables
public static <T,U,R> Iterable<R> zipMap(Iterable<T> left, Iterable<U> right, BiFunction<T,U,R> f){
return () -> new Iterator<R>() {
final Iterator<T> leftIter = left.iterator();
final Iterator<U> rightIter = right.iterator();
@Override
public boolean hasNext() {
if( leftIter.hasNext() ^ rightIter.hasNext()){
throw new IllegalStateException("left and right had unequal lengths");
}
@lbergelson
lbergelson / install_git_lfs
Created August 20, 2015 15:41
script to install git-lfs on travis and fetch with it
#!/bin/bash
echo "cloning"
git clone git@github.com:github/git-lfs.git
echo "cd into git-lfs"
cd git-lfs
echo "checkout commit 4457d7c7c5906025f753579f67f975792235b717"
git checkout 4457d7c7c5906025f753579f67f975792235b717
@lbergelson
lbergelson / updateFiles.sh
Created July 28, 2015 18:56
Script to update bam and sam files to sam spec version 1.5
function updateSam {
hellbender PrintReads --disable_all_read_filters -I $1 -O out.sam && echo "moving out.sam to $1" && mv out.sam $1
}
function updateBam {
hellbender PrintReads --disable_all_read_filters -I $1 -O out.bam && echo "moving out.bam to $1" && mv out.bam $1
samtools index $1
}
autoload -U zargs