This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import cv2 | |
# pass either device id (0 usually for webcam) or path to a video file | |
cam = cv2.VideoCapture(0) | |
# a list of installed haar cascades. The upperbody and mcs_upperbody cascades | |
# are best for me, as the glasses block face detection | |
cascades = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
# Cairo - for creating images outside of X | |
# ggplot2 - the MAGIC | |
# RMySQL - for interacting with the MySQL database | |
# yaml - for storing database credentials | |
suppressPackageStartupMessages( require( "Cairo" , quietly=TRUE ) ) | |
suppressPackageStartupMessages( require( "ggplot2" , quietly=TRUE ) ) | |
suppressPackageStartupMessages( require( "RMySQL" , quietly=TRUE ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use feature qw{ say state } ; | |
use strict ; | |
use warnings ; | |
my %hash ; | |
my @list = @ARGV ; | |
if ( !scalar @list ) { | |
while (<STDIN>) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
input=$1 | |
output=$2 | |
if [ -f $input ] | |
then | |
/usr/bin/convert "$input" -colors 2 -colorspace gray -normalize $output | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for z in *.zip | |
do | |
echo "$z" | |
mkdir "${z%%.*}" | |
mv "$z" "${z%%.*}" | |
cd "${z%%.*}" | |
unzip "$z" | |
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# retrieves the current temperature from REDIS to be used in the bash prompt | |
# I should also get curr_time and, if the difference is too big, prints nothing | |
# but not implemented yet. | |
use feature qw{ say state unicode_eval unicode_strings } ; | |
use strict ; | |
use warnings ; | |
use utf8 ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'm reading in a logfile that holds hourly load averages from several hosts | |
logfile = read.table('.uptime.log') | |
# these log entries run hourly and take the form | |
# 2017/01/01 00:02:01 genomics-test : 0.36 0.09 0.03 | |
# 2017/01/01 00:02:02 genomics : 0.04 0.03 0.04 | |
# 2017/01/01 00:02:02 genomics-db : 0.12 0.05 0.01 | |
# 2017/01/01 00:02:04 genomics-apps : 1.87 1.24 0.79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# the program that cleans up the QuBit directory, copying the CSVs to directories | |
# corresponding to the day they were created | |
use strict ; | |
use warnings ; | |
use feature qw'say state signatures' ; | |
no warnings qw{experimental::signatures} ; | |
use utf8 ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT wr.request_num req | |
, COUNT( ws.id ) count | |
, ( | |
SELECT MAX(submission) | |
FROM wideseq_status st | |
WHERE wr.id = st.request_id | |
) scount | |
, ( | |
SELECT MAX(status) | |
FROM wideseq_status ss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use feature qw{ say state } ; | |
use strict ; | |
use warnings ; | |
use Data::Dumper ; | |
use lib join '/', $ENV{HOME}, 'lib' ; | |
use Coffee ; |