This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
d3.phylogram.js | |
Wrapper around a d3-based phylogram (tree where branch lengths are scaled) | |
Also includes a radial dendrogram visualization (branch lengths not scaled) | |
along with some helper methods for building angled-branch trees. | |
d3.phylogram.build(selector, nodes, options) | |
Creates a phylogram. | |
Arguments: | |
selector: selector of an element that will contain the SVG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: $0 source_dir [source_dir] ... | |
# where source_dir args are directories containing git repositories | |
red="\033[00;31m" | |
green="\033[00;32m" | |
yellow="\033[00;33m" | |
blue="\033[00;34m" | |
purple="\033[00;35m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'date' | |
def date_of_last(day) | |
date = Date.parse(day) | |
delta = date > Date.today ? 7 : 0 | |
(date - delta) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################## | |
# client.py | |
import requests | |
url = 'http://localhost:5000/' | |
requests.post(url) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BeautifulSoup(open('fragment.html'), 'html5lib').select('div.secondary strong') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
port=22 | |
while getopts "p:" opt; do | |
case "$opt" in | |
\?) | |
echo "bad opt" | |
exit 1 | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ inv working | |
'working' did not receive all required positional arguments! | |
$ inv nonworking | |
should error | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// first example | |
App.Router.map(function () { | |
this.resource('address', { path: '/:address_id' }, function() { | |
this.resource('thread', { path: '/:thread_id' }); | |
}); | |
this.resource('tag', { path: '/tag/:tag' }, function() { | |
this.resource('thread', { path: '/:thread_id' }); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.{Instant, ZoneId, LocalDateTime} | |
import io.circe.{Encoder, Decoder} | |
import io.circe.syntax._ | |
trait LocalDateTimeCodec { | |
val UTC = ZoneId.of("UTC") | |
implicit val dateTimeEncoder: Encoder[LocalDateTime] = Encoder.instance( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.fuze.perseus.flink | |
class FailingExample[T](s: Concrete[T])(implicit tc: Typeclass[T]) | |
class WorkingExample[T](s: Concrete[T]) | |
trait Typeclass[T] | |
trait Concrete[T] | |
object Concrete { | |
val instance = new Concrete[Int] {} | |
} |