Skip to content

Instantly share code, notes, and snippets.

@numpde
numpde / fdr.py
Last active November 9, 2020 11:32
Visualization of the FDR and estimates by Benjamini-Hochberg and Storey-Tibshirani
# RA, 2020-10-16
"""
Visualization of the FDR and estimates by Benjamini-Hochberg and Storey-Tibshirani.
[1] Benjamini Y and Hochberg Y.
Controlling the false discovery rate: a practical
and powerful approach to multiple testing.
J R Statist Soc B, 1995.
@eliocamp
eliocamp / new_aes.R
Last active June 16, 2023 09:07
A way to add multiple color or fill scales to a ggplot2 plot
# All this is implemented (plus bugfixes!) in the ggnewscale package:
# https://github.com/eliocamp/ggnewscale
# If you have any issues, I prefer it if you send them as issues here:
# https://github.com/eliocamp/ggnewscale/issues
#' Allows to add another scale
#'
#' @param new_aes character with the aesthetic for which new scales will be
#' created
#'
@loilo
loilo / split-pull-requests.md
Last active April 3, 2024 07:24
Split a large pull request into two
@ahmed-musallam
ahmed-musallam / compress_pdf.md
Last active March 10, 2024 13:53
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

@anapsix
anapsix / mouse_latlon.py
Last active November 4, 2020 12:45
mouse position on screen in python
#!/usr/bin/env python
# I didn't write this
# many examples exist on StackOverflow, etc..
#
# Note: you'll need python-xlib, python-gtk
# sudo apt-get install python-xlib python-gtk2
#
import sys
import os
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing