Skip to content

Instantly share code, notes, and snippets.

View mz2's full-sized avatar

Matias Piipari mz2

View GitHub Profile
module WMC
# NoyesParser parses motif files with a header line and
# column lines with symbols in the DNA alphabet in order A,C,G,T
class NoyesParser
attr_accessor :motifset
attr_accessor :nukelinepattern
attr_accessor :namepattern
attr_accessor :normalize
#import "NSArray+UniqueObjects.h"
@implementation NSArray (UniqueObjects)
-(NSArray*) uniqueObjects {
NSSet *set = [[NSSet alloc] initWithArray: self];
NSArray *vals = [set allObjects];
[set release];
return vals;
@mz2
mz2 / NSArray+UniqueObjects.h
Created March 21, 2010 23:12
NSArray+UniqueObjects.h: get unique objects from an NSArray, whilst maintaining sort ordering
#import <Foundation/Foundation.h>
@interface NSArray (UniqueObjects)
-(NSArray*) uniqueObjects;
-(NSArray*) uniqueObjectsSortedUsingSelector: (SEL)comparator;
-(NSArray*) uniqueObjectsSortedUsingFunction: (NSInteger (*)(id, id, void *)) comparator
@mz2
mz2 / gist:1917390
Created February 26, 2012 15:24
R CMD check issues
Undocumented S4 methods:
generic '$' and siglist '_p_PEER__cEpsNodeSparse'
generic '$' and siglist '_p_PEER__cSPARSEFA'
generic '$' and siglist '_p_PEER__cWNodeSparse'
generic '$<-' and siglist '_p_PEER__cWNodeSparse'
generic '[' and siglist 'ExternalReference'
generic '[<-' and siglist 'ExternalReference'
generic '[[<-' and siglist '_p_PEER__cWNodeSparse,character'
generic 'length' and siglist 'SWIGArray'
//
// NSString+Levenshtein.h
// PyHelp
//
// Modified by Michael Bianco on 12/2/11.
// <http://mabblog.com>
//
// Created by Rick Bourner on Sat Aug 09 2003.
// rick@bourner.com
@mz2
mz2 / .gitlab-ci.yml
Created March 27, 2017 11:22
An example .gitlab-ci.yml for running Vapor tests
before_script:
- git submodule update --init --recursive
cache:
key: ${CI_BUILD_REF_NAME}
paths:
- .build
build:
script:
@mz2
mz2 / Dockerfile
Created March 27, 2017 11:50
Example Dockerfile for running Vapor tests.
# adapted from https://github.com/swiftdocker/docker-swift
# once docker-swift supports setting the swift version via a build-arg we could pull from there instead
FROM ubuntu:14.04
ENV SWIFT_BRANCH swift-3.0.2-release
ENV SWIFT_VERSION 3.0.2
ENV SWIFT_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
ENV SWIFT_SIG_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz.sig
ENV SWIFT_PLATFORM ubuntu14.04
@mz2
mz2 / run-docker
Created March 27, 2017 12:01
Example script that can be used to execute a Vapor app inside Docker connected to the Xcode console
#!/bin/bash
# $PATH tweak done so this also runs from Xcode.
PATH="/usr/local/bin:${PATH}"
./kill-docker
docker run --rm -it -v $PWD:/vapor -p 5432 -p 8080:8080 \
-e HOST_IP=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1') \
manuscript-annotations
@mz2
mz2 / kill-docker
Created March 27, 2017 12:05
An example script that kills previous instance(s) of a docker container with name "manuscript-annotations"
#!/bin/bash
# $PATH tweak done so this also runs from Xcode.
PATH="/usr/local/bin:${PATH}"
if [[ $(docker ps -q --filter=ancestor=manuscript-annotations) ]]; then
docker stop $(docker ps -q --filter=ancestor=manuscript-annotations)
fi
@mz2
mz2 / gist:a70694d7f260b46013055bf8b1380e9e
Created March 27, 2017 13:13
Example Dockerfile for Heroku deployment
# adapted from https://github.com/swiftdocker/docker-swift
# once docker-swift supports setting the swift version via a build-arg we could pull from there instead
FROM ubuntu:14.04
ENV SWIFT_BRANCH swift-3.0.2-release
ENV SWIFT_VERSION 3.0.2
ENV SWIFT_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
ENV SWIFT_SIG_URL https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz.sig
ENV SWIFT_PLATFORM ubuntu14.04