Skip to content

Instantly share code, notes, and snippets.

Avatar

Anderson Cardoso andersoncardoso

  • Porto - Portugal
View GitHub Profile
@andersoncardoso
andersoncardoso / downloads.nim
Created September 30, 2018 12:53
donwload eny files from ub v1
View downloads.nim
import db_postgres, os, httpclient, threadpool
const BASE = "https://s3.amazonaws.com/unbounded-uploads/attachments/"
proc download_and_save(row: Row) =
let url = BASE & row[0] & "/" & row[1]
let dirname = "tmp/attachments/" & row[0]
let filename = dirname & "/" & row[1]
createDir(dirname)
newHttpClient().downloadFile(url, filename)
View credential_sample.json
{
"@context": {
"schema": "http://schema.org/",
"dc": "http://purl.org/dc/elements/1.1/",
"dct": "http://dublincore.org/terms/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"ctdl": "[CTI Namespace Not Determined Yet]"
},
"@type": "cti:Credential",
View credential-schema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"allOf": [
{
"$ref": "http://localhost:9292/api/schemas/json_ld"
},
{
"$ref": "#/definitions/schemaorg_creative_work"
},
{
@andersoncardoso
andersoncardoso / cred_sample_jsonld.json
Created July 19, 2016 15:44
sample of a credential jsonld parsed from rdf
View cred_sample_jsonld.json
{
"@context": {
"cti": "http://purl.org/cti/terms/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"schema": "http://schema.org/",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
@andersoncardoso
andersoncardoso / credential-schema.json
Created June 28, 2016 15:34
schema-json example for credentials
View credential-schema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "CredentialRegistry Credential metadata",
"type": "object",
"definitions": {
"cti": {
"properties": {
"@type": {
"enum": [
"cti:Credential"