Skip to content

Instantly share code, notes, and snippets.

View neilfws's full-sized avatar

Neil Saunders neilfws

View GitHub Profile
@aplz
aplz / fasttext_cv.py
Created September 5, 2018 16:15
sklearn cross-validation for fasttext
import argparse
import os
import fasttext
from sklearn.base import BaseEstimator
from sklearn.metrics import f1_score
from sklearn.model_selection import cross_val_score, StratifiedKFold
def read_data(data_dir):
@edvinasbartkus
edvinasbartkus / gist:0e99ea8305a20737f562
Last active May 20, 2022 11:08
Ruby puma.gem install on El Capitan / Mac Sierra
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib
@hubgit
hubgit / pubmed-commons.php
Created April 23, 2015 11:28
PubMed Commons API
<?php
if (isset($_GET['pmid'])) {
$json = file_get_contents('http://www.ncbi.nlm.nih.gov/myncbi/comments/?' . http_build_query(array(
'p$rq' => 'CommL.CommServer:com',
'cmd' => 'get',
'recid' => $_GET['pmid'],
)));
$data = json_decode($json, true);
@Robinlovelace
Robinlovelace / load-mapinfo-mid.R
Last active November 15, 2017 03:07
Loading MapInfo .mid files with R
# Loading MapInfo .mid files
library(rgdal) # rgdal library
drvs <- ogrDrivers() # ogr capabilities
drvs[grep("Inf", drvs$name),] # test MapInfo reading capability of gdal
f <- "folder/filename.mid" # filename
l <- ogrListLayers(f) # layer name
sp_object <- readOGR(f, layer = l[[1]]) # load!
@saraemoore
saraemoore / boxplot_attempt1.r
Created March 25, 2014 17:27
ggplot geom_boxplot with box fill and correctly spaced x-axis scale
library(ggplot2)
ggplot(data.df, aes(x=factor(time), y=value)) +
geom_boxplot(aes(fill=measure)) +
xlab("Time (time units)") + ylab("Value (value units)") +
scale_fill_discrete(name = "Measure")
@tommorris
tommorris / readme.txt
Created September 25, 2012 14:24
query to get all universities with lat-longs in Alabama
PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
SELECT ?college ?lat ?long
WHERE {
{
@seandavi
seandavi / somaticScan.sh
Created June 13, 2011 13:17
Call varScan using named pipes (fifos)
#!/bin/bash
#
# Author: Sean Davis <seandavi@gmail.com>
#
# Uses named pipes (FIFO) to reduce storage needs
# to call varscan somatic
# Some details may need to be edited to meet particular needs
# call with the following parameters
# 1) The FASTA file containing the reference genome
# 2) The Normal bam file