Skip to content

Instantly share code, notes, and snippets.

@laughedelic
laughedelic / gist:8538472
Last active January 3, 2016 23:59
TitanDB: checking, that multi-value property doesn't add duplicates
> import com.thinkaurelius.titan.core._
> import com.tinkerpop.blueprints.Vertex
> val g = TitanFactory.open(".")
> g.makeKey("k").dataType(classOf[String]).list().unique().indexed(classOf[Vertex]).make()
// is there any nicer way of creating TitanVertex?
> val v = g.addVertex(null).asInstanceOf[TitanVertex]
> v.addProperty("k", "foo")
@laughedelic
laughedelic / go-model.json
Last active August 29, 2015 14:03
Json representation of the GO Bio4j module
{
"label" : "go",
"properties" : [
{
"label" : "id",
"type" : "java.lang.String"
},
{
"label" : "name",
"type" : "java.lang.String"
{
"schemas" : [
{
"label" : "enzymedb",
"properties" : [
{
"label" : "id",
"type" : "java.lang.String"
},
{
@laughedelic
laughedelic / tabulaInANutshell.scala
Created September 5, 2014 15:49
This is kind of a minimal example of the tags failure. Works with the commented variation.
import ohnosequences.pointless._, AnyTaggedType._
trait AnyAct {
type Itm <: AnyTaggedType
val itm: Itm
// type Out[I <: Itm] = Tagged[I]
type Out = Tagged[Itm]
}
@laughedelic
laughedelic / Readme.md
Last active August 29, 2015 14:23
Typing unicode symbols in Atom (temporary solution)

Temporary solution for typing unicode symbols in Atom

Usage

  1. Install autocomplete-plus and autocomplete-snippets plugins
  2. Add these snippets to your snippets.cson
  3. Try typing u and the LaTeX name of the symbol you want and you should get autocompletetion with a preview of the symbol

Notes

@laughedelic
laughedelic / .ensime
Created August 18, 2015 10:59
Problem with atom-ensime server connection (https://github.com/ensime/ensime-atom/issues/53)
(
:root-dir "/Users/laughedelic/dev/ohnosequences/statika"
:cache-dir "/Users/laughedelic/dev/ohnosequences/statika/.ensime_cache"
:name "statika"
:java-home "/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home"
:java-flags ("-Xms1024m" "-Xmx1024m" "-XX:ReservedCodeCacheSize=128m" "-XX:MaxMetaspaceSize=256m")
:reference-source-roots ("/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/src.zip")
:scala-version "2.11.7"
:compiler-args ("-feature" "-language:higherKinds" "-language:implicitConversions" "-language:postfixOps" "-deprecation" "-unchecked" "-Xlint" "-Xplugin:/Users/laughedelic/.ivy2/cache/org.brianmckenna/wartremover_2.11/jars/wartremover_2.11-0.13.jar")
scala> val conf = new org.apache.commons.configuration.BaseConfiguration()
conf: org.apache.commons.configuration.BaseConfiguration = org.apache.commons.configuration.BaseConfiguration@3ada9e37
scala> conf.setProperty("storage.directory", "/media/ephemeral0/applicator/16s/bio4j")
scala> conf.setProperty("storage.backend", "berkeleyje")
scala> val graph = new com.bio4j.titan.model.ncbiTaxonomy.TitanNCBITaxonomyGraph( new com.bio4j.titan.util.DefaultTitanGraph( com.thinkaurelius.titan.core.TitanFactory.open(conf) ) )
17:46:21.350 [main] DEBUG c.t.t.d.b.BerkeleyJEStoreManager - Opened database system_properties
java.lang.Throwable: null

Keybase proof

I hereby claim:

  • I am laughedelic on github.
  • I am laughedelic (https://keybase.io/laughedelic) on keybase.
  • I have a public key whose fingerprint is 138C F048 DC2E CC17 FBF1 3DD2 90A9 4E49 D72F 180F

To claim this, I am signing this object:

@laughedelic
laughedelic / BotAuthRedirect.yaml
Created February 25, 2017 14:59
AWS API Gateway OAuth redirect to a Telegram bot's deep link
---
swagger: "2.0"
info:
version: "2017-02-25T14:22:32Z"
title: "BotAuthRedirect"
schemes:
- "https"
paths:
/:
x-amazon-apigateway-any-method:
@laughedelic
laughedelic / merge.sh
Created July 11, 2017 07:57
A script for merging MG7 output tables using Metaphlan utility
#!/bin/bash
# project specific constants
name="m16s6mangel"
# should return sample prefix for a given index
function sample_prefix() {
echo "MAGEL${1}_S${1}"
}
# arguments