Skip to content

Instantly share code, notes, and snippets.

View seralf's full-sized avatar
🎯
Focusing

Alfredo Serafini seralf

🎯
Focusing
View GitHub Profile
#!/usr/bin/env node
//please requist your app token from
//https://trello.com/1/connect?key=yourkey&name=git-hook&expiration=never&response_type=token&scope=read,write
var key = "your key";
var token = "your token";
//https://trello.com/board/-/4e9003324a517dad44465056
var board_id = "4e9003324a517dad44465056";
var Trello = require("node-trello");
@seralf
seralf / char_entity_replace.scala
Created October 19, 2013 22:42
Simple draft idea for implementing a facility object for entity char replacement in HTML text
// idea for mapping: TODO
val mapping = """
{ %7B
} %7D
( %28
) %29
< %3C
> %3E
? %3F
@seralf
seralf / thymeleaf_template_from_externalFile.scala
Created October 26, 2013 14:26
A simple template scala Application to test Thymeleaf locally (without spring, and outside servlet a context)
package thymeleaf
import org.thymeleaf.TemplateEngine
import org.thymeleaf.templateresolver.TemplateResolver
import org.thymeleaf.templateresolver.FileTemplateResolver
import org.thymeleaf.resourceresolver.FileResourceResolver
import org.thymeleaf.context.Context
import java.io.Writer
import java.io.PrintWriter
import java.io.File
function getTweets(searchTerm, maxResults, sinceid, languageCode) {
//Based on Mikael Thuneberg getTweets - mod by mhawksey to convert to json
// if you include setRowsData this can be used to output chosen entries
var data = [];
var idx = 0;
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sumSheet = ss.getSheetByName("Readme/Settings");
if (isConfigured()){
var oauthConfig = UrlFetchApp.addOAuthService("twitter");
oauthConfig.setAccessTokenUrl("https://api.twitter.com/oauth/access_token");
#!/bin/bash
path="$(dirname "$(readlink -f "$0")" )"
checkexe(){
if [[ ! -f "$path/savihost.exe" ]]; then
echo "[!] savihost.exe was not found in directory $path"
echo "[!] please go to http://www.hermannseib.com/english/savihost.htm and download it"
exit 1
fi
}
@seralf
seralf / _virtuoso_VOD7_ubuntu_installation.sh
Last active July 31, 2017 13:07
This is a simple checklist for installing a Virtuoso Opens Source 7 on ubuntu (debian? sholud be the same) environment.
## VIRTUOSO
http://localhost:8890/
http://localhost:8890/sparql
http://localhost:8890/conductor
#### pre-install:
These commands are suggested in the documentation

Movies Recommendation:

Music Recommendation:

@seralf
seralf / TestTinkerpopVirtuosoSPARQL.java
Last active January 8, 2016 08:38
Testing virtuoso with Tinkerpop, via Sail
public class TestTinkerpopVirtuosoSPARQL {
public static void main(String[] args) throws Exception {
Graph graph = new SparqlRepositorySailGraph("http://localhost:8890/sparql");
int i = 0;
Iterable<Edge> edges = graph.getEdges();
for (Edge edge : edges) {
System.out.println(edge);
@seralf
seralf / json_data.json
Created April 2, 2014 22:20
Idea on how to render data to CSV from JSON, using mustache syntax: http://mustache.github.io/mustache.5.html
{
"items": [
{"name": "nome", "surname": "cognome", "city": "Rome", "header": true},
{"name": "Mario", "surname": "Rossi", "city": "Rome"},
{"name": "Paperino", "surname": "Paolino", "city": "Paperopoli"}
]
}
var yasqe = YASQE(document.getElementById("yasqe"), {
sparql: {
showQueryButton: true
}
});
var yasr = YASR(document.getElementById("yasr"), {
//this way, the URLs in the results are prettified using the defined prefixes in the query
getUsedPrefixes: yasqe.getPrefixesFromQuery
});