Skip to content

Instantly share code, notes, and snippets.

View armish's full-sized avatar
🔬
here and there

B. Arman Aksoy armish

🔬
here and there
View GitHub Profile
with(x, {
f(z)
})
# Which of the following statements is this equivalent to?
#
# a) x$f(x$z)
# b) f(x$z)
# c) x$f(z)
# d) f(z)
@derekpowell
derekpowell / R-rotate-axis-labels.R
Created January 23, 2018 22:51
R: rotate ggplot axis labels 90 degrees
theme(axis.text.x = element_text(angle = 90, hjust = 1))
@mutterer
mutterer / googly_eyes_Tool.ijm
Last active January 19, 2021 08:45
Googly eyes tool
// this example uses the Toolbar.setIcon(toolName,icon) method
// added in v1.53h, to dynamically update its icon.
macro "Left Eye Action Tool - N44 C000 o00nn" {
setTool("Googly Eyes Tool")
}
macro "Right Eye Action Tool - N44 C000 o00nn" {
setTool("Googly Eyes Tool")
}
@pgm
pgm / correlation_from_csv.py
Created September 22, 2020 02:30
Script based on code from the DepMap portal code to compute the top N pearson correlations and write to a CSV file
import argparse
import sqlite3
import sys
import numpy as np
import pandas as pd
def main():
parser = argparse.ArgumentParser()
parser.add_argument("in_csv_0")
@edsu
edsu / replies.py
Last active December 7, 2022 18:59
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
@SimplGy
SimplGy / renameToHash.sh
Last active July 27, 2023 07:30
Rename files with a hash based on their contents. eg: `abc.jpg` to `3101ace8db9f.jpg`. Useful for detecting duplicates.
#!/bin/bash
# TODO: skip tiny files (so small they couldn't be photos)
# TODO: make sure sym links and other file system oddities are handled
# TODO: look at paralellization for perf boost
#
# Constants
#
CHAR_COUNT=12
BLOCK_COUNT=6
@aileftech
aileftech / hex-colors.txt
Created October 1, 2022 18:10
A Bash one-liner to produce a list of HEX color codes that read like (supposedly) valid English words
$ grep -P "^[ABCDEFabcdefOoIi]{6,6}$" /usr/share/dict/words | tr 'OoIi' '0011' | tr '[:lower:]' '[:upper:]' | awk '{print "#" $0}'
#ACAD1A
#B0BB1E
#DEBB1E
#AB1DED
#ACAC1A
#ACCEDE
#AC1D1C
#BAB1ED
#BA0BAB
@ckandoth
ckandoth / ensembl_vep_102_with_offline_cache.md
Last active November 7, 2023 14:32
Install Ensembl's VEP v102 with local cache for running offline

Ensembl's VEP (Variant Effect Predictor) is popular for how it picks a single effect per gene as detailed here, its CLIA-compliant HGVS variant format, and Sequence Ontology nomenclature for variant effects.

Instead of the official instructions, we will use conda to install VEP and its dependencies. If you don't already have conda, install it into $HOME/miniconda3 as follows:

curl -sL https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh -o /tmp/miniconda.sh
sh /tmp/miniconda.sh -bfp $HOME/miniconda3

Add the conda bin folder into your $PATH so that all installed tools are accessible via command-line. You can also add this to your ~/.bashrc

@hadley
hadley / ds-training.md
Created March 13, 2015 18:49
My advise on what you need to do to become a data scientist...

If you were to give recommendations to your "little brother/sister" on things that they need to do to become a data scientist, what would those things be?

I think the "Data Science Venn Diagram" (http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram) is a great place to start. You need three things to be a good data scientist:

  • Statistical knowledge
  • Programming/hacking skills
  • Domain expertise

Statistical knowledge

#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.