Skip to content

Instantly share code, notes, and snippets.

View samuell's full-sized avatar
💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
View GitHub Profile
use std::io::fs::File;
enum ReadState {
Normal,
Newline,
Skipline,
}
fn main() {
let mut at = 0i;
@knewter
knewter / roles_elixir_tasks_main.yml
Created August 18, 2014 14:23
elixir ansible deploy
---
- name: Create directory to put elixir in
sudo: 'yes'
shell: "mkdir -p /opt/elixir/v0.15.0"
- name: Install unzip
apt: name=unzip state=present update_cache=true
- name: Unzip elixir release
sudo: 'yes'
@behe
behe / gc_count.exs
Last active November 11, 2016 09:38 — forked from samuell/gc_count.exs
defmodule ATGCCount do
def count(sequence), do: cnt(String.to_char_list(sequence),0,0)
def cnt([65|t],at,gc), do: cnt(t,at+1,gc)
def cnt([84|t],at,gc), do: cnt(t,at+1,gc)
def cnt([71|t],at,gc), do: cnt(t,at,gc+1)
def cnt([67|t],at,gc), do: cnt(t,at,gc+1)
def cnt([62|_],at,gc), do: {at,gc}
def cnt([],at,gc), do: {at,gc}
# def cnt(_,0,0), do: {0,0}
def cnt([_|t], at, gc), do: cnt(t,at,gc)
@Ismael-VC
Ismael-VC / gc_count.jl
Last active July 13, 2017 17:52
GC Count
#!/usr/bin/env julia
function gc_count(fasta::String)
file = open(fasta, "r")
lines = readall(file)
gc = at = 0
for c in lines.data
if (c == 'G') || (c == 'C')
gc += 1
@lindenb
lindenb / README.md
Created March 21, 2018 17:39
parsing drugbang XML->TSV using XSLT . keywords java xslt jvarkit xsltstream drugbank
@sgsfak
sgsfak / Drugbank parse to DB
Last active December 23, 2018 08:11
Parse DrugBank XML file with xmlstarlet
We couldn’t find that file to show.
@lindenb
lindenb / Drugbank.java
Created March 21, 2018 15:56
Parsing drugbank using a xml schema and java keywords: drugbank xjc xsd schema xml java javac
/*
Author: Pierre Lindenbaum @yokofakun
related:
http://bionics.it/posts/parsing-drugbank-xml-or-any-large-xml-file-in-streaming-mode-in-go
*/
import ca.drugbank.*;
import java.util.*;
import java.util.stream.*;
SELECT node.title,timestamp,node_revisions.body
FROM node
LEFT JOIN node_revisions ON node.vid=node_revisions.vid
INTO OUTFILE '/tmp/nodes.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@markjay4k
markjay4k / animated3Dplot.py
Last active April 24, 2024 00:13
animated 3D example using PyQtGraph and OpenGL
# -*- coding: utf-8 -*-
"""
Animated 3D sinc function
"""
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import numpy as np
import sys