Skip to content

Instantly share code, notes, and snippets.

function Person(firstName) {
var that = this;
console.log('************************************************************** P');
console.log('============================================================== P');
console.log('"this" inside constructor "Person", before anything else');
console.log(this);
this.firstName = firstName;
(function test1() {
@ariutta
ariutta / README.md
Last active August 29, 2015 14:16
JSON-LD and TypeScript experiment.

TypeScript and JSON-LD now both have type information, with TypeScript describing program APIs and JSON-LD describing Linked Open Data. Could TypeScript and JSON-LD work together to make these two play well with each other? This example is a start for exploring what that could look like. Possible applications:

  • Notifications of type incompatibilities between a program and a REST API
  • Code completion for editors/IDEs
  • Documentation generation for both program and REST APIs
  • ...

And now that AtScript and TypeScript have merged, it would be cool to see OData and JSON-LD work together for a similar merge in the future.

The JSON-LD is based on [this example](http://json-ld.org/playground/index.html#startTab=tab-expanded&json-ld=%7B%22%40context%22%3A%7B%22gr%22%3A%22http%3A%2F%2Fpurl.org%2Fgoodrelations%2Fv1%23%22%2C%22pto%22%3A%22http%3A%2F%2Fwww.productontology.org%2Fid%2F%22%2C%22foaf%22%3A%22http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%22%2C%22xsd%22%3

@ariutta
ariutta / query-name-ensembl.jsonld
Created January 1, 2015 21:36
Expected results when querying BridgeDb for "ensembl", using the bridgedbjs library.
[{
"@context": {
"@vocab": "http://www.example.org/bridgedb/input-vocab/",
"alternatePrefix": {
"@id": "idot:alternatePrefix",
"@type": "xsd:string"
},
"baseIri": "@base",
"biopax": {
"@id": "http://www.biopax.org/release/biopax-level3.owl#",
{
"@context": ["http://test2.wikipathways.org/v2/contexts/pathway.jsonld", {
"@base": "identifiers:WP525/"
}],
"id":"wikpathways:WP525",
"entities": [{
"textAlign": "center",
"borderWidth": 1,
"@type": [
"protein",
@ariutta
ariutta / index.html
Last active August 29, 2015 13:58 — forked from bumbu/index.html
<!DOCTYPE html>
<html>
<head>
<title>Pathvisiojs Demos</title>
<script src="./../dist/lib/jquery/js/jquery.min.js"></script>
<script src="pathvisiojs.js"></script>
<script>
$(function(){
$('#path1').pathvisiojs()
$('#path2').pathvisiojs()
{
"@context": {
"HMDB": "http://www.hmdb.ca/metabolites/",
"CAS": "http://commonchemistry.org/ChemicalDetail.aspx?ref=",
"ChEBI": "http://www.ebi.ac.uk/chebi/searchId.do?chebiId=",
"chemspider": "http://www.chemspider.com/Chemical-Structure.",
"EntrezGene":"http://www.ncbi.nlm.nih.gov/gene/",
"Ensemble":"http://ensemblgenomes.org/id/",
"GeneOntology":"http://www.ebi.ac.uk/QuickGO/GTerm?id=GO:",
"ex": "http://example.org/vocab#",
{
"@context": {
"HMDB": "http://www.hmdb.ca/metabolites/",
"CAS": "http://commonchemistry.org/ChemicalDetail.aspx?ref=",
"ChEBI": "http://www.ebi.ac.uk/chebi/searchId.do?chebiId=",
"chemspider": "http://www.chemspider.com/Chemical-Structure.",
"EntrezGene":"http://www.ncbi.nlm.nih.gov/gene/",
"Ensemble":"http://ensemblgenomes.org/id/",
"GeneOntology":"http://www.ebi.ac.uk/QuickGO/GTerm?id=GO:",
"ex": "http://example.org/vocab#",
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style>
body {
font: 10px sans-serif;
}
/*
.drag-handle {
@ariutta
ariutta / annotated.css
Last active August 29, 2015 13:56
d3-drag-examples
.jsondiffpatch-annotated-delta {
font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-size: 12px;
margin: 0;
padding: 0 0 0 12px;
display: inline-block;
}
.jsondiffpatch-annotated-delta pre {
font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
@ariutta
ariutta / corresponding-gpml.xml
Last active January 3, 2016 12:09
Sample pathvisiojs data model. It uses "connector" to refer to GPML elements of type Interaction and GraphicalLine, and it uses "div" in the HTML sense to indicate elements that should be rendered as containers. These divs are used for GPML elements of type Group, DataNode, Label and Shape. Just as in HTML, divs can contain child elements. In or…
<?xml version="1.0" encoding="UTF-8"?>
<Pathway xmlns="http://pathvisio.org/GPML/2013a" Name="Fluoropyrimidine Activity" Organism="Homo sapiens" License="CC BY 2.0">
<Comment Source="WikiPathways-description">The main mechanism of 5-FU activation is conversion to fluorodeoxyuridine monophosphate (FdUMP) which inhibits the enzyme thymidylate synthase (TYMS), an important part of the folate-homocysteine cycle and purine and pyrimidine synthesis The conversion of 5-FU to FdUMP can occur via thymidylate phosphorylase (TYMP) to fluorodeoxyuridine (FUDR) and then by the action of thymidine kinase to FdUMP or indirectly via fluorouridine monophosphate (FUMP) or fluroridine (FUR) to fluorouridine diphosphate (FUDP) and then ribonucleotide reductase action to FdUDP and FdUMP. FUDP and FdUDP can also be converted to FUTP and FdUTP and incorporated into RNA and DNA respectively which also contributes to the pharmacodynamic actions of fluoropyrimidines.
Sources: [http://www.pharmgkb.org/do/serve?objId=PA150653776&amp;