Skip to content

Instantly share code, notes, and snippets.

View seralf's full-sized avatar
🎯
Focusing

Alfredo Serafini seralf

🎯
Focusing
View GitHub Profile

Movies Recommendation:

Music Recommendation:

@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
#!/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
}
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");
@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
@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
#!/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 / StanfordNERExample.scala
Last active June 6, 2018 22:39
A simple, introductory example, to play with Stanford Named Entity Recognition tool with the scala language. NOTE: the model used here is one of the provided model in the standard distribution.
package ner
import edu.stanford.nlp.ie.crf.CRFClassifier
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import edu.stanford.nlp.ling.CoreAnnotations
import java.util.ArrayList
import java.util.HashMap
import java.util.Map
import scala.xml.XML
@seralf
seralf / webserver.py
Last active July 17, 2023 02:49
Start a local webserver into the current directory, for serving local static files. (This is useful when testing ajax locally on json, for example.)
#!/usr/bin/python
# start an http webserver serving static files from the local directory, using python
python -m SimpleHTTPServer 7777 &
@seralf
seralf / merge-pdf.sh
Created June 9, 2013 11:40
merge several pdf in alphabetical order
# merge several pdf in alphabetical order
pdftk *.pdf cat output mergedFile.pdf