Skip to content

Instantly share code, notes, and snippets.

View IsmailM's full-sized avatar
👋
Focusing

Ismail Moghul IsmailM

👋
Focusing
View GitHub Profile
@IsmailM
IsmailM / GeneValidator_dependencies.md
Last active April 27, 2016 15:54
GeneValidatorApp & GeneValidator Dependencies Installation

#Dependencies

GeneValidatorApp and GeneValidator have a number of dependencies (including Ruby, Mafft & BLAST) that need to be installed first.

##Ruby (>= 2.0.0)

  1. Install Ruby Version Manager
$ curl -sSL https://get.rvm.io | bash -s stable --ruby
@IsmailM
IsmailM / ORF_coverage.rb
Last active August 29, 2015 14:19
Find the ORF coverage
require 'bio'
def analyse_input_file(input_file)
overall_results = []
biofastafile = Bio::FlatFile.open(Bio::FastaFormat, input_file)
biofastafile.each_entry do |entry|
overall_results << analyse_orfs(entry.entry_id, entry.naseq)
end
overall_results
end
@IsmailM
IsmailM / split_fasta.rb
Last active August 29, 2015 14:27
SPLIT MULTIPLE FASTA FILE into separate fasta files with id as filename
require 'bio' # you have to install bioruby - gem install bio
require 'fileutils'
# Run by running:
## ruby split_fasta.rb FASTA_FILE MIN MAX OUTPUT_DIR
fasta = ARGV[0]
min = ARGV[1]
@IsmailM
IsmailM / mycd.sh
Last active September 8, 2015 15:55 — forked from slowkow/mycd.sh
Record folder-specific history in `.dir_bash_history`
function cd_dir_history()
{
OLDPWD="$PWD"
echo "# $(date) $USER -> $@" >> "$HISTFILE"
command cd "$@"
# If this directory is writable then write to directory-based history file
# otherwise write history in the usual home-based history file.
touch "$PWD/.dir_bash_history" 2>/dev/null \
@IsmailM
IsmailM / Agnoster
Last active October 14, 2015 07:21
Custom Agnoster theme - with fish-like collapsed directories and without the unnecessary WHOAMI part and
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
@IsmailM
IsmailM / waitForKeyElements.js
Created January 26, 2016 00:38 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@IsmailM
IsmailM / app.rb
Created March 15, 2016 23:58 — forked from nu7hatch/app.rb
OmniAuth login in popup
require 'rubygems'
require 'sinatra'
require 'omniauth/oauth'
set :sessions, true
set :layout, true
use OmniAuth::Builder do
provider :twitter, 'key', 'secret'
end

Jekyll is a great tool for building static sites, however, I often see many projects that are including a lot of unused CSS. Since Jekyll generates an entire working site in the _site directory, we can use it to run uncss. Below outlines an example project using uncss and a build.js script.

Note: this assumes you have node and npm installed.

Setting up the project

Firstly, let's set up the project.

jekyll new uncss-example && cd uncss-example
suppressMessages(library("GEOquery"))
gse <- getGEO('GDS6', GSEMatrix = TRUE)
eset <- GDS2eSet(gse, do.log2 = FALSE)
X <- exprs(eset) # Get Expression Data
X <- X[rowSums(is.na(X)) != ncol(X),] # remove rows with missing data
knnImputation(X, scale=F)
@IsmailM
IsmailM / random_R_script.R
Created May 19, 2016 12:16
shows how to use named lists
# A really really cool method that does extremely important stuff (Careful, don't break it or the world might fall apart)
# x has to be larger than 2)
random <- function(x) {
n <- sample(1:x, 3) # get 3 random numbers between 1 and x
results <- list(num1 = n[1],
num2 = n[2],
num3 = n[3])
return(results)
}