Skip to content

Instantly share code, notes, and snippets.

@emepyc
emepyc / README.md
Last active August 29, 2015 14:10
TnT as a web component

Simple TnT tree using polymer web elements

@emepyc
emepyc / README.md
Created December 2, 2014 13:27
Example of communication between web components

Simple communication between web components

@emepyc
emepyc / README.md
Last active August 29, 2015 14:22
branch lengths

The scale method specifies if the tree should be rendered using the tree's branch lengths or not (true by default). Branch lengths are computed taking the branch_length property of the tree object. This is normally set automatically when your input is a newick formatted tree that includes branch lengths. If scale is set to false, branch lengths are ignored and the tree will display in an isometric layout (all paths from leaves to root having the same length).

type Header []byte
type Hit struct {
subject Header
gi int
qfrom, qto, sfrom, sto int
bitsc float32
}
func parseLine (line Line) *Hit {
@emepyc
emepyc / gist:1322637
Created October 28, 2011 16:05
goroutines filling a channel in the order they are fired
package main
import (
"fmt"
"runtime"
"time"
)
func init() {
runtime.GOMAXPROCS(4)
package main
import (
"time"
"runtime"
"fmt"
)
var (
closeRead = make(chan bool)
package main
import (
"time"
"runtime"
"fmt"
)
var (
qstate = make(chan int, 8)
@emepyc
emepyc / index.html
Created November 29, 2012 15:01
Pie chart updates in D3.js
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
    <script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="donut.js"></script>
</head>
<body>
<script type="text/javascript">
var innerRadius = 120;
@emepyc
emepyc / _.md
Created November 29, 2012 16:43
Horizontal bar charts with update