Skip to content

Instantly share code, notes, and snippets.

View fils's full-sized avatar
:octocat:

Douglas Fils fils

:octocat:
View GitHub Profile
@fils
fils / templateTest.dart
Created April 10, 2013 20:49
Demonstration of an issue I am seeing with Dart Mustache templating
import 'package:mustache/mustache.dart' as mustache;
void main() {
var legSet = [{'legnumber': 207, 'is_last': false}, {'legnumber': 208, 'is_last': false}, {'legnumber': 209, 'is_last': false}, {'legnumber': 210, 'is_last': true}];
var source = ("""
SELECT DISTINCT ?slice
FROM <http://data.oceandrilling.org/janus/>
WHERE {
@fils
fils / janusMatrix.json
Created April 17, 2013 14:47
JSON data file used in another Gist. The JSON structure is from a SPARQL reply from a Virtuoso triple store. It's structure is set by standards.
{ "head": { "link": [], "vars": ["leg", "site", "param", "count"] },
"results": { "distinct": false, "ordered": true, "bindings": [
{ "leg": { "type": "literal", "value": "201" } , "site": { "type": "literal", "value": "1225" } , "param": { "type": "uri", "value": "http://data.oceandrilling.org/core/1/janus/totalCore" } , "count": { "type": "typed-literal", "datatype": "http://www.w3.org/2001/XMLSchema#integer", "value": "69" }},
{ "leg": { "type": "literal", "value": "201" } , "site": { "type": "literal", "value": "1225" } , "param": { "type": "uri", "value": "http://data.oceandrilling.org/core/1/janus/sampleCount" } , "count": { "type": "typed-literal", "datatype": "http://www.w3.org/2001/XMLSchema#integer", "value": "3446" }},
{ "leg": { "type": "literal", "value": "201" } , "site": { "type": "literal", "value": "1225" } , "param": { "type": "uri", "value": "http://data.oceandrilling.org/core/1/janus/msl_section" } , "count": { "type": "typed-literal", "datatype": "http://www.w3.org/2001/XM
@fils
fils / janusMatrix.html
Created April 17, 2013 14:49
This HTML file has Dart code in it. I am trying to bind the datatable var to the table using webui binding. Can not resolve the issue with it. I can set the var statically but not update it as I change it. Would love the two binding to enable simple sorting and filtering later.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css">
<link href="https://google-developers.appspot.com/maps/documentation/javascript/examples/default.css"
rel="stylesheet">
@fils
fils / vocGraph.go
Created May 8, 2013 17:26
Working on some Go code to read in weighted relations in a graph (non-directional)
package main
// Reads in a file formated like"
// 8,9,5 // string1, string2, weightInt
// where string1 is a node, string 2 is a node connected
// to string1 by weightInt
// Needs a way to enter the key value relation for
// string1 and string2 (which is not in the data file right now)
import (
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
"@id": "http://data.oceandrilling.org/janus/parameter/sampleCount/201/1225/1313",
"@type": [
"http://www.coreref.org/drilling/1/coredata",
@fils
fils / gist:5759722
Last active December 18, 2015 09:09
{
"@context": {
"dc": "http://purl.org/dc/elements/1.1/",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"_links": {
"IMLGS": {
"href": "http://www.ngdc.noaa.gov/geosamples/", "media-type": "text/html"
},
"IODP": {
@fils
fils / iodputil.dart
Last active December 21, 2015 07:19
Working on Dart and polymer via http calls
library iodputil;
import 'dart:html';
import "dart:json";
class iodputil {
String encodeComponent(String component) {
if (component == null) return component;
return component.replaceAll(':', '%3A')
.replaceAll('/', '%2F')
@fils
fils / microToRDF.py
Created August 22, 2014 20:30
Using the Python Creepy package and Apache Any23 to mine a sites schema.org (microdata) to RDF for display
from creepy import Crawler
# todo: write to a file, filter out the css related triples
class MyCrawler(Crawler):
def process_document(self, doc):
if doc.status == 200:
#print '[%d] %s' % (doc.status, doc.url)
# There is also doc.text one could work with
packet = urllib.quote_plus(doc.url)
@fils
fils / dataset.jsonld
Last active August 29, 2015 14:28
Just some thoughts on what I would include in a schema.org/Dataset jsonld package
{
"@context": "http://schema.org",
"@type": "Dataset",
"distribution": {
"@type": "DataDownload",
"url" : "http://foo.org/datasets/set1.jsonld"
}
"spatial" : {
"@type": "Place",
"geo": {
package main
import (
"database/sql"
"gopkg.in/rana/ora.v3"
"log"
"testing"
)
func init() {