Skip to content

Instantly share code, notes, and snippets.

View alexpreynolds's full-sized avatar
👋
Hello

Alex Reynolds alexpreynolds

👋
Hello
  • Altius Institute for Biomedical Sciences
  • Seattle, WA USA
  • 20:46 (UTC -07:00)
View GitHub Profile
@nitrogenlogic
nitrogenlogic / 00_popen3_moved.md
Last active March 7, 2025 10:07
Two implementations of a popen3() function in POSIX/C providing stdin, stdout, and stderr
@kueda
kueda / d3.phylogram.js
Last active May 8, 2024 17:33
Right-angle phylograms and circular dendrograms with d3. To preview see http://bl.ocks.org/kueda/1036776
/*
d3.phylogram.js
Wrapper around a d3-based phylogram (tree where branch lengths are scaled)
Also includes a radial dendrogram visualization (branch lengths not scaled)
along with some helper methods for building angled-branch trees.
Copyright (c) 2013, Ken-ichi Ueda
All rights reserved.
@sente
sente / objwalk.py
Created December 15, 2011 09:54
Recursively walk Python objects (Python recipe)
"""
http://code.activestate.com/recipes/577982-recursively-walk-python-objects/
A small function that walks over pretty much any Python object and yields the
objects contained within (if any) along with the path to reach them. I wrote it
and am using it to validate a deserialized data-structure, but you can probably
use it for many things.
Example use: In one configuration mechanism I implemented, there exists an
UNCONFIGURED sentinel that marks configuration items that are required but
@stefanschmidt
stefanschmidt / uninstall-parallels7-ml.sh
Last active July 13, 2020 05:45
Completely Uninstall Parallels Desktop 7 on OS X 10.8 (Mountain Lion)
# Unload all Parallels kernel extensions
for kext in $(kextstat | grep parallels | awk '{print $6}'); do kextunload -v 1 -b $kext; done
# Delete all Parallels kernel extensions
rm -v /System/Library/Extensions/prl*
# Delete all other Parallels files
rm -vr \
/Applications/Parallels\ Desktop.app \
/Library/Parallels/Parallels\ Service.app \
@rnkoaa
rnkoaa / app.js
Created January 9, 2014 13:14
A simple angularjs with angular-ui modal form which includes validation on the client side. Thanks http://scotch.io/tutorials/javascript/angularjs-form-validation
var app = angular.module("modalFormApp", ['ui.bootstrap']);
app.controller("modalAccountFormController", ['$scope', '$modal', '$log',
function ($scope, $modal, $log) {
$scope.showForm = function () {
$scope.message = "Show Form Button Clicked";
console.log($scope.message);
var modalInstance = $modal.open({
@beci
beci / gcc 5 on ubuntu 14.04
Created October 15, 2015 07:18
use gcc 5.x on ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
@benmarwick
benmarwick / 000_geom_bag.r
Last active January 5, 2025 01:16
Basic bagplot geom for ggplot2
#' Bagplot
#'
#' The bag geom is useful for graphical summaries of scatterplots. It
#' is effective at showing the location, spread, skewness, and
#' outliers of a data set.
#'
#' A bagplot is a bivariate generalization of the well known boxplot. It
#' was proposed by Rousseeuw, Ruts, and Tukey. This geom plots bagplots that
#' are very similar to the one described in Rousseeuw et al. and
#' uses code from their bagplot functions in the aplpack pacakge.
@gboeing
gboeing / pypi.md
Last active June 17, 2022 16:11
How to organize and distribution a package on pypi

To distribute a package on pypi

Directory structure

/project/
    /package/
        __init__.py
        module.py
 setup.py
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rberenguel
rberenguel / mand.ps
Created May 31, 2019 14:23
Simple Mandelbrot set generator in PostScript
%!PS-Adobe-2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Mandelbrot set via PostScript code. Not optimized %
% in any way. Centered in A4 paper. Escape time, B&W %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/fun {