Skip to content

Instantly share code, notes, and snippets.

View mcandre's full-sized avatar

Andrew mcandre

  • Milwaukee, WI
View GitHub Profile
#!/usr/bin/perl -ws
#
# just-the-tables.pl
#
# Summary
#
# Strips most HTML formatting, leaving tables.
#
# Example
#
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
import System.Environment (getArgs, getProgName)
import Control.Monad (forM_, replicateM_)
import Data.Binary (Binary, encode, decode)
import Data.Typeable (Typeable)
import Data.ByteString.Lazy (ByteString)
import Control.Concurrent (threadDelay)
import Data.Rank1Dynamic (toDynamic)
import Control.Distributed.Static
( Static
# sample data:
#
# row_num,gene_id,ensembl_gene_symbol,gene_symbol,entrez_id
# 1,66982,"ENSG00000000003","TSPAN6",7105
# 2,66983,"ENSG00000000005","TNMD",64102
# 3,66984,"ENSG00000000419","DPM1",8813
# 4,66985,"ENSG00000000457","SCYL3",57147
# ...
#!/usr/bin/perl
@mcandre
mcandre / gist:6645844
Created September 21, 2013 00:51 — forked from pyrtsa/gist:6213784

When installing Haskell Platform fails on Mac OS X (with quick fix below)

I was fighting with Haskell last weekend. At first, I couldn't install some missing libraries with Cabal, and then, when trying to find out what's wrong, I ended up removing the whole Haskell installation — only to find out I could no longer install neither the Haskell Platform nor even just Cabal Install! The warnings I would see were more or less about the use of the single quote in source code:

Preprocessing library text-0.11.2.3...

Data/Text.hs:6:52:
     warning: missing terminating ' character [-Winvalid-pp-token]

-- Copyright : (c) 2009, 2010, 2011, 2012 Bryan O'Sullivan,

#!/bin/bash
if [ "" = "$2" ]
then
dA=`wget -O- "http://backend.deviantart.com/rss.xml?q=gallery%3A$1+sort%3Atime&type=deviation"`
else
dA=`wget -O- "$2"`
fi
echo $dA | xmlstarlet sel -T -t -v //media:content/@url | xargs wget
#!/bin/bash
if [ "" = "$2" ]
then
dA=`wget -O- "http://backend.deviantart.com/rss.xml?q=gallery%3A$1+sort%3Atime&type=deviation"`
else
dA=`wget -O- "$2"`
fi
echo $dA | xmlstarlet sel -T -t -v //media:content/@url | xargs wget
@mcandre
mcandre / stuns
Last active August 29, 2015 14:12 — forked from zziuni/stuns
# Stun servers
#
# Source: http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
#
# Example:
#
# $ brew install stuntman
# $ stunclient stun.ekiga.net
# Binding test: success
# Local address: 192.168.1.13:58717
@mcandre
mcandre / .Xresources
Last active August 29, 2015 14:13 — forked from vreon/.Xresources
! Molokai theme
*xterm*background: #101010
*xterm*foreground: #d0d0d0
*xterm*cursorColor: #d0d0d0
*xterm*color0: #101010
*xterm*color1: #960050
*xterm*color2: #66aa11
*xterm*color3: #c47f2c
*xterm*color4: #30309b
*xterm*color5: #7e40a5
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
@mcandre
mcandre / uninstall-razer-synapse.sh
Created August 30, 2017 01:06 — forked from timotgl/uninstall-razer-synapse.sh
How to fully uninstall Razer Synapse on OS X El Capitan without using Razer's official uninstall tool
# How to uninstall Razer Synapse ( http://www.razerzone.com/synapse/ )
# on OS X El Capitan without using Razer's official uninstall tool.
# Tested on OS X 10.11.5 in July 2016.
# Step 1: In your terminal: stop and remove launch agents
launchctl remove com.razer.rzupdater
launchctl remove com.razerzone.rzdeviceengine
sudo rm /Library/LaunchAgents/com.razer.rzupdater.plist
sudo rm /Library/LaunchAgents/com.razerzone.rzdeviceengine.plist