Skip to content

Instantly share code, notes, and snippets.

View taniki's full-sized avatar
🛠️

tam kien duong taniki

🛠️
View GitHub Profile
@taniki
taniki / gist:741857
Created December 15, 2010 10:51
jesse fulton's EmoTe
$text = $_GET['text'];
$scope = Eklekt_Emotion_Empathyscope::getInstance();
$es = $scope->feel($text);
print(json_encode($es));
exit;
PREFIX dbo: <http://dbpedia.org/ontology/>
select distinct ?person ?influenced ?influencedBy
where {
{
?person
rdf:type dbo:Philosopher ;
foaf:name ?nameperson .
OPTIONAL {
@taniki
taniki / gist:2769308
Created May 22, 2012 14:07
merge of birthdate and birthyear when birthdate not available
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?person ?birthdate
WHERE {
?person rdf:type dbo:Philosopher .
{
?person dbo:birthDate ?birthdate .
FILTER( datatype(?birthdate) != xsd:gMonthDay ).
@taniki
taniki / gist:2775275
Created May 23, 2012 13:39
extraction of philosophers
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX w3: <http://www.w3.org/2001/XMLSchema#>
CONSTRUCT {
?s ?p ?o.
}
WHERE {
?s rdf:type dbo:Philosopher.
?s ?p ?o.
}
@taniki
taniki / gist:2775359
Created May 23, 2012 13:55
extraction of philosophers influenced and influencedBy
PREFIX dbo: <http://dbpedia.org/ontology/>
CONSTRUCT {
?s dbo:influencedBy ?t1.
?s dbo:influenced ?t2.
}
where {
?s rdf:type dbo:Philosopher.
OPTIONAL { ?s dbo:influencedBy ?t1. ?t1 rdf:type dbo:Person. }
@taniki
taniki / gist:2926046
Created June 13, 2012 19:47
access allow in bones/nodejs
server = Bones.Server.extend({});
server.prototype.initialize = function(app) {
this.use(this.allow.bind(this));
};
server.prototype.allow = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET');
next();
@taniki
taniki / List of installed modules.md
Last active December 12, 2015 03:18
my basic sublime text config
  • Package controller
  • Emmet
  • GitGutter
  • SublimeREPL
@taniki
taniki / gist:5133358
Last active December 14, 2015 18:59
how to get anti-alias with R (and knitr) under ubuntu

I had to switch to a personal ubuntu PC lately. I already tried to get anti-alias in R outputs on my ubuntu workstation but failed and relied on an imac to get pixel perfect plot (ggplot2 <3). The latter one use QUARTZ by default and I tried to install quickly Cairo but it was not very simple and did not got time to fix it. Now that I have to, I did it. It is a minor problem and I am sure it will help other ubuntu R users (:

The problem is that :

  • install.packages("Cairo") outputs dependencie errors without telling explicitly how to fix them (particulary libxt)
  • apt-get install r-cran-cairo does install something but it does not appear in R and does not fetch dependencies either

Then in the terminal, you will first need to :

@taniki
taniki / Dockerfile
Created September 9, 2013 14:54
docker builder : cortext-projects
FROM ubuntu:12.10
RUN apt-get install -y curl git
RUN curl https://install.meteor.com | /bin/sh
RUN git clone https://github.com/cortext/cortext-projects
EXPOSE 3000:3000
@taniki
taniki / Dockerfile
Created September 12, 2013 20:10
docker builder : cortext-aut
FROM ubuntu:12.10
# https://github.com/dotcloud/docker/issues/1024
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q mysql-server
RUN apt-get install -y php5-cli php5-mysql php5-curl php5-sqlite
RUN apt-get install -y git